...is not a function, array, macro or linked list
Moderators: gnozal, ABBKlaus, lexvictory
...is not a function, array, macro or linked list
New to TailByte. But I'm getting this error and I'm not sure why?
I basically created my the code like I would for a dll. And TailByte creates the lib just fine but when I go to test it I get the error.
I basically created my the code like I would for a dll. And TailByte creates the lib just fine but when I go to test it I get the error.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
Code: Select all
ProcedureDLL AnimateSprite(Sprite, ClipWidth, ClipHeight, FramesPerRow, NumberOfFrames, StartFrame, EndFrame, FpsDelay)
Structure SpriteCalculations
LoopFrames.l
Loop.l
XStart.l
YStart.l
EndStructure
Static Dim Sprites.SpriteCalculations(99)
FramesPerColumn = Round((NumberOfFrames / FramesPerRow), #PB_Round_Up)
Sprites(Sprite)\LoopFrames + 1
If Sprites(Sprite)\LoopFrames > EndFrame
Sprites(Sprite)\LoopFrames = StartFrame
EndIf
If Sprites(Sprite)\LoopFrames = StartFrame
DivXStart = Round(StartFrame / FramesPerRow, #PB_Round_Down)
MulXStart = DivXStart * FramesPerRow
MinXStart = StartFrame - MulXStart
Sprites(Sprite)\XStart = (MinXStart * ClipWidth) - ClipWidth
If Sprites(Sprite)\XStart < 0
Sprites(Sprite)\XStart = 0
EndIf
Sprites(Sprite)\YStart = (Round(StartFrame / FramesPerColumn, #PB_Round_Up) * ClipHeight) - ClipHeight
EndIf
DivXEnd = Round(StartFrame / FramesPerRow, #PB_Round_Down)
MulXEnd = DivXEnd * FramesPerRow
MinXEnd = StartFrame - MulXEnd
XEnd = (MinXend * ClipWidth) - ClipWidth
YEnd = (Round(StartFrame / FramesPerColumn, #PB_Round_Up) * ClipHeight) - ClipHeight
ClipSprite(Sprite, Sprites(Sprite)\XStart, Sprites(Sprite)\YStart, ClipWidth, ClipHeight)
If Sprites(Sprite)\Loop > FpsDelay
Sprites(Sprite)\XStart + ClipWidth
If Sprites(Sprite)\XStart = ClipWidth * FramesPerRow
Sprites(Sprite)\YStart + ClipHeight
DivXStart = Round(StartFrame / FramesPerRow, #PB_Round_Down)
MulXStart = DivXStart * FramesPerRow
MinXStart = StartFrame - MulXStart
Sprites(Sprite)\XStart = (MinXStart * ClipWidth) - ClipWidth
If Sprites(Sprite)\XStart < 0
Sprites(Sprite)\XStart = 0
EndIf
EndIf
Sprites(Sprite)\Loop = 1
If Sprites(Sprite)\XStart = XEnd And Sprites(Sprite)\YStart = YEnd
Sprites(Sprite)\LoopFrames = StartFrame - 1
EndIf
Else
Sprites(Sprite)\LoopFrames - 1
Sprites(Sprite)\Loop + 1
EndIf
EndProcedure
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
Yeah I tried restarting the compiler and even closing PB and restarting it.lexvictory wrote:You did restart the compiler after creating the lib didn't you?
That message usually means you didn't. (or TB is not configured properly)
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I can think of 3 possibilities :...is not a function, array, macro or linked list
1. Your forgot to use ProcedureDLL instead of Procedure
-> Not the case, your code is ok
2. You didn't restart the compiler
-> Not the case, you did.
3. Your library doesn't exist in %YourPBDirectory%\PureLibraries\UserLibraries
-> Not the case.
Then I don't know !
Last edited by gnozal on Wed May 20, 2009 1:57 pm, edited 3 times in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Yesgnozal wrote:Maybe a path issue ?
Does your library exist in %YourPBDirectory%\PureLibraries\UserLibraries ?
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
lexvictory wrote:can you run tailbite on the file using /LOGF as a parameter (edit the tool), and post the log (see the help for its location)
- Parameter() :C:\Documents and Settings\J. Baker\My Documents\PureBasic\AnimateSprite.pb
Parameter() :/LOGF
GetPBFolder()
Detected OS : Windows XP/Server 2003
HKCU\Software\Classes\PureBasic.exe\shell\open\command="C:\Program Files\PureBasic\PureBasic.exe" "%1" /P "C:\Documents and Settings\J. Baker\Application Data\PureBasic\PureBasic.prefs" /T "C:\Documents and Settings\J. Baker\Application Data\PureBasic\Templates.prefs" /A "C:\Documents and Settings\J. Baker\Application Data\PureBasic\Tools.prefs"
OSVersion()=60
C:\Program Files\PureBasic\tailbite\TailBite.exe
PureBasic Version found : 4.30 C 2008 FANTAISIE SOFTWARE / 430 /X86
Mode=0
GetPBFolder()=C:\Program Files\PureBasic\
TBPreferencesPath$=C:\Documents and Settings\J. Baker\Application Data\TailBite\
TBPrefsFile$=C:\Documents and Settings\J. Baker\Application Data\TailBite\TailBite_430.prefs
PBCompilerFolder$=C:\Program Files\PureBasic\compilers\
PrefsFound=1
PBFolder$=C:\Program Files\PureBasic\
TBFolder$=C:\Program Files\PureBasic\tailbite\
LibSourceFolder$=C:\Documents and Settings\J. Baker\My Documents\TailBite Library Sources\
LastFile$=
ManagerOnTop=0
PBSubsystem$=purelibraries\userlibraries\
Language$=English
PBPreferencesPath$=C:\Documents and Settings\J. Baker\Application Data\Purebasic\
TBTempPath$=C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\
pb_align$=pb_align
pb_bssalign$=pb_bssalign
LibraryMakerOptions$= /COMPRESSED /NOUNICODEWARNING
IsPB410=1
LibraryMaker$=C:\Program Files\PureBasic\\SDK\LibraryMaker.exe
TailBite Version found : 1.4.0
Libexe$=C:\Program Files\PureBasic\compilers\polib.exe
LibexeBaseName$=polib
Inc_Taibite > MainProc()
LibName$=AnimateSprite
HelpName$(read from old userlib)=AnimateSprite.chm
CopyFile ok :C:\Program Files\PureBasic\purelibraries\userlibraries\animatesprite -> C:\Documents and Settings\J. Baker\Local Settings\Temp\TB_AnimateSprite_728B5142
recover=1
Opening PB 4.30 C 2008 FANTAISIE SOFTWARE asm source...
PBCompile(C:\Documents and Settings\J. Baker\My Documents\PureBasic\AnimateSprite.pb,, /COMMENTED /DEBUGGER /EXE "C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\PureBasic.exe")
ExecuteProgram("C:\Program Files\PureBasic\compilers\pbcompiler.exe","C:\Documents and Settings\J. Baker\My Documents\PureBasic\AnimateSprite.pb" /COMMENTED /DEBUGGER /EXE "C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\PureBasic.exe",)
RunProgram(C:\Program Files\PureBasic\compilers\pbcompiler.exe,"C:\Documents and Settings\J. Baker\My Documents\PureBasic\AnimateSprite.pb" /COMMENTED /DEBUGGER /EXE "C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\PureBasic.exe",)
Creating function list...
Inc_Taibite > CreateFunctionList()
- Function index 0
function()\ID=0
function()\RetValue$=None
function()\Name$=AnimateSprite
function()\PlainName$=AnimateSprite
function()\Args$=, Long, Long, Long, Long, Long, Long, Long, Long
function()\nArgs=8
function()\Main=1
function()\maxArgs=8
function()\HelpLine$=(Sprite, ClipWidth, ClipHeight, FramesPerRow, NumberOfFrames, StartFrame, EndFrame, FpsDelay)
function()\DLLFunction=1
function()\FIndex=0
function()\Modifiers$=
function()\DebugFunction=0
function()\nModifiers=0
function()\VarArgs$=
function()\VarArgStr$=
function()\VarHelpStr$=
- Function index 1
function()\ID=1
function()\RetValue$=InitFunction
function()\Name$=AnimateSprite_Init
function()\PlainName$=AnimateSprite_Init
function()\Args$=
function()\nArgs=0
function()\Main=1
function()\maxArgs=0
function()\HelpLine$=
function()\DLLFunction=1
function()\FIndex=-1
function()\Modifiers$=
function()\DebugFunction=0
function()\nModifiers=0
function()\VarArgs$=
function()\VarArgStr$=
function()\VarHelpStr$=
HelpName$=AnimateSprite.chm
Splitting functions...
Inc_Taibite > SplitFunctions()
System function found : KERNEL32
===============C:\Documents and Settings\J. Baker\My Documents\TailBite Library Sources\AnimateSprite\AnimateSprite.Desc===============
=======================================================================================================================================
Compiling asm code...
RunProgram(C:\Program Files\PureBasic\compilers\fasm.exe,Functions\AnimateSprite.asm Functions\AnimateSprite.obj,C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\)
RunProgram(C:\Program Files\PureBasic\compilers\fasm.exe,Functions\AnimateSprite_Init.asm Functions\AnimateSprite_Init.obj,C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\)
RunProgram(C:\Program Files\PureBasic\compilers\fasm.exe,Functions\AnimateSpriteShared.asm Functions\AnimateSpriteShared.obj,C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\)
RunProgram(C:\Program Files\PureBasic\compilers\fasm.exe,Functions\Shared\AnimateSprite_End.asm Functions\Shared\AnimateSprite_End.obj,C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\)
Compiling lib file...
RunProgram("C:\Program Files\PureBasic\compilers\polib.exe",/out:AnimateSprite.lib @AnimateSpriteObjFiles.txt,C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\)
Making PB library...
RunProgram("C:\Program Files\PureBasic\\SDK\LibraryMaker.exe", /TO "C:\Program Files\PureBasic\purelibraries\userlibraries" /COMPRESSED /NOUNICODEWARNING "C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\AnimateSprite.Desc",C:\Documents and Settings\J. Baker\Local Settings\Temp\TBTemp\41B94AB55B093590\)
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
hmmm. according to that, it all worked fine.
All works fine here too (x86 and x64)
Come to think of it, I think I've had problems before when the UserLib name (the source file name in TB's case) has the same name as the Procedure.
Try renaming the source file, delete the userlib, and Tailbite it again...
All works fine here too (x86 and x64)
Come to think of it, I think I've had problems before when the UserLib name (the source file name in TB's case) has the same name as the Procedure.
Try renaming the source file, delete the userlib, and Tailbite it again...
Demonio Ardente
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
[ERROR] Invalid memory access. [read error at address 0]lexvictory wrote:hmmm. according to that, it all worked fine.
All works fine here too (x86 and x64)
Come to think of it, I think I've had problems before when the UserLib name (the source file name in TB's case) has the same name as the Procedure.
Try renaming the source file, delete the userlib, and Tailbite it again...
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
That's not good as I need Static.ABBKlaus wrote:you can´t use static inside ProcedureDLL, use a Global in the initfunction insteadJ. Baker wrote:[ERROR] Invalid memory access. [read error at address 0]
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
It will be needed to animate more then one sprite. I'll have to come up with another method.lexvictory wrote:Why? So long as you don't use the variable name elsewhere it's the same thing.J. Baker wrote:That's not good as I need Static.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.