dodicat wrote:Not very neat.
Actually, I find that very neat. Structurally, I buy into all of that.
It had not occurred to me to use a macro and I had not seen the Preprocessor Stringize (#) before. I don't have sufficient confidence in the language to use Var so tend to steer clear of it.
Our coding styles differ: I tend to use a lot of white space, capitalization, indentation and long names rather than letters.
For what it is worth I ended up with this.
Code: Select all
#Macro DeclareMacro( ProcName, Proc_List, LibName, LibFunctionName )
Dim ProcName As Proc_List
Scope
Dim As Any Ptr Library = Dylibload( LibName )
If Library = 0 Then Print "Error loading " + #LibName : Sleep : End
ProcName = Dylibsymbol( Library, LibFunctionName )
If ProcName = 0 Then Print "Error finding " + #LibFunctionName : Sleep : End
End Scope
#Endmacro