IonicWind Software

Creative Basic => Console Programs => Topic started by: Ionic Wind Support Team on September 03, 2007, 07:51:01 PM

Title: Sample missing from archive
Post by: Ionic Wind Support Team on September 03, 2007, 07:51:01 PM
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.
Title: Re: Sample missing from archive
Post by: pistol350 on September 04, 2007, 06:18:37 AM
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.
Title: Re: Sample missing from archive
Post by: GWS on September 04, 2007, 10:48:31 AM
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