A sample program that didn't make it into the install. c_dll.cba
'Using the C runtime DLL with Creative BASIC.
' All functions in the C runtime DLL (crtdll.dll) are CDECL so you need to tell
' Creative BASIC to use that calling method by specifying the ! symbol as the first character of
' The DLL name. Some short examples:
' Functions starting with an underscore must be aliased to work properly
openconsole
setprecision 10
DECLARE "!crtdll.dll", strcpy(dest as string,source as string),string
DECLARE "!crtdll.dll", strdate ALIAS _strdate(format as string),string
DECLARE "!crtdll.dll", atof(num as string),double
DEF source,dest,date as STRING
source = "a string to copy"
strcpy(dest,source)
PRINT "Copied string = ",dest
strdate(date)
PRINT "Todays Date is ",date
PRINT atof("1.23e-5")
do:until inkey$ <> ""
closeconsole
One thing the original IBasic couldn't handle was a double/float return from a CDECL DLL function. Creative BASIC handles them fine.
Paul.
LOL!
I go for Creative Basic and I know how much Graham loves that language :)
I really like the idea of the revival of Ibasic Std but improved and again with full support :-*
I hope that this will be a call to all the former pixia Users who vanished .
Cheers!
Peter B.
It's a breath of coding freedom again .. and fun .. :)
Already there are so many examples of 'Creativity' based on the straightforward tools that the new Creative Basic provides.
best wishes, :)
Graham