Recent Posts

Pages: 1 ... 8 9 [10]
91
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 31, 2024, 07:17:40 PM »
The Windows 32 bit ScriptBasic 3.0 release will only be offered in binary format as an installer. It will offer the following features.
  • A CallByName COM extension module with VB6 support.
  • cURL extension module for http(s) access.
  • ODBC direct C API extension module. (no OLEDB)
  • SDL-gfx extension module for games and general graphics.
  • MySQL C API extension module. (fastest DB I've used)
  • SQLite extension module. (:memory: and file DBs)
  • DLLC extension module for FFI scripting  and O2 virtual functions including ASM.
  • SBT extension module for running scripts as threads and embedding libscriba in ScriptBasic.
  • JSON extension module.
  • MXML extension module.
  • ScriptBasic Application Web Server (standalone / proxy)
  • WEBEXT extension module for JSON ScriptBasic associative arrays.
  • ZLIB in memory compression extension module.

This distribution will be available from the ScriptBasic repository with examples and documentation wiki. I'll post the source to the extension modules which can be compiled with TDM-GCC-32. Hopefully others will extend the modules by including missing functions and features.

The ScriptBasic 64 bit version is focused on web apps and glue scripts that may be run in the Windows scheduler. This version should be used if you plan on modifying ScriptBasic source.
92
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 30, 2024, 12:38:15 PM »
The ScriptBasic COM extension integrates well with VB6 allowing callbacks to ScriptBasic on VB6 events. I use VB6  to create form and class OCXs (DLLs) with ScriptBasic as the main program. The screen shot attached is a time keeping project I did for a client. This is the OCX form / class library for the project.
93
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 30, 2024, 10:30:38 AM »
This is an example of some of the SDL-gfx graphics primitives. The SDL-gfx extension module was the best example of using CBASIC. SDL- gfx Source

Code: ScriptBasic
  1. ' SDL_gfx Demo
  2.  
  3. IMPORT gfx.sbi
  4.  
  5. win = gfx::Window(700, 600, "ScriptBasic SDL_gfx Demo")
  6. gfx::pixelRGBA(win, 10, 15, 255, 255, 255, 255)
  7. gfx::lineRGBA(win, 20, 10, 70, 90, 255, 0, 0, 255)
  8. gfx::trigonRGBA(win, 500, 50, 550, 200, 600, 150, 0, 255, 255, 255)
  9. gfx::filledTrigonRGBA(win, 200, 200, 300, 50, 400, 200, 0, 0, 255, 255)
  10. gfx::rectangleRGBA(win, 10, 300, 100, 380, 0, 255, 0, 255)
  11. gfx::boxRGBA(win, 210, 76, 325, 300, 255, 0, 0, 150)
  12. gfx::ellipseRGBA(win, 600, 400, 50, 90, 255, 255, 0, 200)
  13. gfx::filledEllipseRGBA(win, 600, 400, 25, 150, 0, 255, 0, 255)
  14. SPLIT "350,275,300,325,350,400,325,325,390,390,375" BY "," TO _
  15.       x[0],x[1],x[2],x[3],x[4],x[5],y[0],y[1],y[2],y[3],y[4]
  16. gfx::polygonRGBA(win, x, y, 6, 255, 255, 255, 155)
  17. SPLIT "400,450,450,425,300,400,410,450,425,500" BY "," TO _
  18.       s[0],s[1],s[2],s[3],s[4],t[0],t[1],t[2],t[3],t[4]
  19. gfx::filledPolygonRGBA(win, s, t, 5, 255, 0, 255, 155)
  20. gfx::stringColor win, 250, 550, "Press ESC key to QUIT" & CHR(0), 0xffffffff
  21. gfx::Update
  22. WHILE gfx::KeyName(1) <> "+escape"
  23. WEND
  24. gfx::Close
  25.  


94
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 29, 2024, 10:50:11 PM »
I'm going to include the SDL-GFX graphic extension module in the ScriptBasic Windows 32 bit installer.

Fern
Code: ScriptBasic
  1. ' ScriptBasic GFX - Fern
  2.  
  3. IMPORT gfx.sbi
  4.  
  5. s = gfx::Window(640,500,"ScriptBasic GFX Fern")
  6. RANDOMIZE(gfx::Time())
  7. SPLITA STRING(3,"0") BY "" TO xy
  8.  
  9. SUB Fern
  10. r = RND() % 100
  11. IF r <= 10 THEN
  12.    SPLIT "0,0,0,0.16,0,0" BY "," TO a,b,c,d,e,f
  13. ELSE IF r > 1 AND r <=86 THEN
  14.    SPLIT "0.85,0.04,-.04,0.85,0,1.60" BY "," TO a,b,c,d,e,f
  15. ELSE IF r > 86 AND r <=93 THEN
  16.    SPLIT "0.2,-.26,0.23,0.22,0,0.16" BY "," TO a,b,c,d,e,f
  17. ELSE
  18.    SPLIT "-.15,0.28,0.26,0.24,0,0.44" BY "," TO a,b,c,d,e,f
  19. END IF
  20. newx = ((a * xy[1]) + (b * xy[2]) + e)
  21. newy = ((c * xy[1]) + (d * xy[2]) + f)
  22. xy[1] = newx
  23. xy[2] = newy
  24. gfx::pixelRGBA s, INT(xy[1]*40+300), INT(-xy[2]*40+450), 0, 210, 55, 255
  25. END SUB
  26.  
  27. ts = gfx::Time()
  28. FOR w=1 TO 250000
  29.     Fern
  30. NEXT
  31. te = gfx::Time()
  32. gfx::stringColor s, 20, 15, "Time: " & FORMAT("%.4f",(te-ts)/1000) & " Seconds." & CHR(0), 0xffffffff
  33. gfx::Update
  34. WHILE gfx::KeyName(1) <> "+escape"
  35. WEND
  36. gfx::Close
  37.  



Mandelbrot
Code: ScriptBasic
  1. ' ScriptBasic GFX - Mandelbrot
  2.  
  3. IMPORT gfx.sbi
  4.  
  5. s = gfx::Window(640,480,"ScriptBasic SDL_gfx Mandelbrot")
  6. ts = gfx::Time()
  7. FOR y = 0 TO 479
  8.   FOR x = 0 TO 639
  9.     cx = (x - 320) / 120
  10.     cy = (y - 240) / 120
  11.     rit = gfx::Mandelbrot(cx, cy, 510)
  12.     gfx::PixelRGBA s, x, y, rit * 32, rit * 16, rit * 8, 255
  13.   NEXT
  14. NEXT
  15. te = gfx::Time()
  16. gfx::stringColor s, 20, 15, "Time: " & FORMAT("%.4f",(te-ts)/1000) & " Seconds." & CHR(0), 0x000000ff
  17. gfx::Update
  18. WHILE gfx::KeyName(1) <> "+escape"
  19. WEND
  20. gfx::Close
  21.  


95
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 29, 2024, 09:58:40 PM »
Here is a screen shot of the ScriptBasic IDE / Debugger working with the COM SAPI component. This feature is only in the 32 bit version of ScriptBasic.


96
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 29, 2024, 08:34:21 PM »
This is an example of using DLLC with the FreeImage library with the functions interface definitions scripted.

Code: ScriptBasic
  1. ' FreeImage Example  
  2.  
  3. DECLARE SUB DLLC_File ALIAS "dllfile" LIB "DLLC"  
  4. DECLARE SUB DLLC_Proc ALIAS "dllproc" LIB "DLLC"  
  5. DECLARE SUB DLLC_Call ALIAS "dllcall" LIB "DLLC"  
  6.  
  7. fih=dllc_file("/scriptbasic/bin/Freeimage.dll")
  8.  
  9. Version = DLLC_Proc(fih,"_FreeImage_GetVersion@0 z = ( )")  
  10. Copyright = DLLC_Proc(fih,"_FreeImage_GetCopyrightMessage@0 z = ( )")  
  11. LoadImage  = DLLC_Proc(fih,"_FreeImage_Load@12 i = (i fif, z filename, i flag)")  
  12. Width = DLLC_Proc(fih,"_FreeImage_GetWidth@4 i = (i dib)")  
  13. Height = DLLC_Proc(fih,"_FreeImage_GetHeight@4 i = (i dib)")  
  14. Rescale = DLLC_Proc(fih,"_FreeImage_Rescale@16 i = (i dib, i dst_width, i dst_height, i filter)")  
  15. Rotate = DLLC_Proc(fih,"_FreeImage_Rotate@16 i = (i dib, d angle, p bkcolor)")  
  16. Save = DLLC_Proc(fih,"_FreeImage_Save@16 b = (i fif, i dib, z fname, i flage)")  
  17.  
  18. CONST FIF_BMP  =  0  
  19. CONST FIF_JPEG =  2  
  20. CONST FIF_PNG  = 13  
  21. CONST FIF_GIF  = 25  
  22. CONST FILTER_BICUBIC = 1  
  23.  
  24. fimg_in    = "world.jpg\0"
  25. fimg_small = "world_small.png\0"
  26. fimg_flip  = "world_flip.png\0"
  27.  
  28. PRINT DLLC_Call(Version),"\n"  
  29. PRINT DLLC_Call(Copyright),"\n"  
  30. fbmp = DLLC_Call(LoadImage, FIF_JPEG, fimg_in, 0)  
  31. PRINT "Width: ",DLLC_Call(Width, fbmp),"\n"  
  32. PRINT "Height: ",DLLC_Call(Height, fbmp),"\n"  
  33. fbmps = DLLC_Call(Rescale, fbmp, 100, 100, FILTER_BICUBIC)  
  34. DLLC_Call(Save, FIF_PNG, fbmps, fimg_small, 0)  
  35. fbmpr = DLLC_Call(Rotate, fbmp, 180, 0)  
  36. DLLC_Call(Save, FIF_PNG, fbmpr, fimg_flip, 0)
  37.  
  38. line input u  
  39.  

Output

C:\ScriptBasic\examples>sbc DllcFreeImage2.sb
3.18.0
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
Width: 225
Height: 225

C:\ScriptBasic\examples>


The world.jpg was the original image. The other two were created with this example.
97
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 29, 2024, 07:47:09 PM »
I'm working on building a ScriptBasic 3.0 32 bit version which will include the following features. I have used non-UI based COM objects with the ScriptBasic web server.

This will be offered in executable form only as a Windows installer. The code is frozen and I have no plans on enhancing the 32 bit version further.
  • COM / OLE / VB6 support
  • VB6 UI based IDE/Debugger
  • DLLC for FFI scripting and O2 virtual DLLs
  • libscriba that works
  • Both console (sbc) and Windows (sbw) interpreters
98
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 29, 2024, 07:14:19 PM »
It would be great if Charles Pegg would lend a hand and get a 64 bit version of DLLC working. Here is a 32 bit example of DLLC creating an virtual DLL with an ASM function using FII scripting for the call definition.

Code: ScriptBasic
  1.  
  2. include dllc.sbi
  3.  
  4.   oxy=dllfile("oxygen.dll")
  5.  
  6.   o2_basic = dllproc( oxy, "o2_basic i =(c*source) " )
  7.   o2_exec  = dllproc( oxy, "o2_exec  i =(i call)   " )
  8.   o2_error = dllproc( oxy, "o2_error c*=()         " )
  9.   o2_errno = dllproc( oxy, "o2_errno i =()         " )
  10.   o2_len   = dllproc( oxy, "o2_len   i =()         " )
  11.   o2_mode  = dllproc( oxy, "o2_mode     (i mode)   " )
  12.  
  13.   dllcall o2_mode,1
  14.  
  15.   function oxygen(src)
  16.   dllcall o2_basic,src
  17.   if (dllcall(o2_errno)<>0) then
  18.     dllprnt dllcall(o2_error)
  19.     a=0
  20.     line input q
  21.   else
  22.     a=dllcall(o2_exec,0)
  23.   end if
  24.   oxygen=a
  25.   end function
  26.  
  27.  
  28. ' ==============================
  29.  src="""
  30.  extern
  31.  
  32.  function reverse(char*s)
  33.  ========================
  34.  addr ecx,s
  35.  mov edx,0
  36. .rlen
  37.  mov al,[ecx]
  38.  cmp al,0
  39.  jz xlen
  40.  inc edx
  41.  inc ecx
  42.  jmp rlen
  43. .xlen
  44.  ;
  45.  addr ecx,s
  46.  add  edx,ecx
  47.  dec ecx
  48.  ;
  49. .rswap
  50.  inc ecx
  51.  dec edx
  52.  cmp edx,ecx
  53.  jle xswap
  54.  mov al,[ecx]
  55.  mov ah,[edx]
  56.  mov [ecx],ah
  57.  mov [edx],al
  58.  jmp rswap
  59. .xswap
  60.  end function
  61.  
  62.  function getword(char*ss,sys*b) as char*
  63.  '=======================================
  64.  sys a
  65.  if not @ss then return ""
  66.  if b=0 then b=1
  67.  byte s at @ss
  68.  byte c,d
  69.  sys bb,bc
  70.  static char z[128]
  71.  a=0
  72.  bb=b
  73.  '
  74.  'SKIP LEADING SPACES
  75.  do
  76.    c=s[b]
  77.    select c
  78.    case 33 to 255,0 : exit do 'SKIP SPACE
  79.    end select
  80.    b++
  81.  end do
  82.  bc=b
  83.  '
  84.  'QUOTES
  85.  select c
  86.  case 34,39
  87.   do
  88.      b+=1
  89.      d=s[b]
  90.      if d=0 or d=c then b+=1 : jmp fwd done
  91.   end do
  92.  end select
  93.  'WORDS AND SYMBOLS
  94.  do
  95.    c=s[b]
  96.    select c
  97.    case 0 to 32     : exit do
  98.    case 35          : jmp fwd more
  99.    case 33  to 47   : 'symbols
  100.    case 48  to 57   : jmp fwd more 'numbers
  101.    case 58  to 64   : 'symbols
  102.    case 65  to 90   : jmp fwd more 'capitals
  103.    case 95          : jmp fwd more 'underscore
  104.    case 91  to 96   : 'symbols
  105.    case 97  to 122  : jmp fwd more 'lower case
  106.    case 123 to 127  : 'symbols
  107.    case 128 to 255  : jmp fwd more 'higher ascii
  108.    end select
  109.    '
  110.    if b=bc then b++
  111.    exit do
  112.    '
  113.    more:
  114.    b++
  115.  end do
  116.  '
  117.  done:
  118.  '
  119.  if b>bb then
  120.    z=mid ss,bc,b-bc
  121.  else
  122.    z=""
  123.  end if
  124.  return z
  125.  
  126.  end function
  127.  
  128.  
  129. =================
  130. Class AlignedText
  131. =================
  132.  
  133. indexbase 1
  134.  
  135. string  buf, bufo, pr, cr, tab, jus, dlm
  136. sys     Cols, Rows, ColWidth[0x100], TotWidth, ColPad, ld
  137.  
  138. method SetText(char*s)
  139. ======================
  140. if not len cr then cr=chr(13,10)
  141. tab=chr(9)
  142. if not len jus then jus=string 200,"L"
  143. buf=s
  144. measure
  145. end method
  146.  
  147.  
  148. method measure()
  149. ================
  150. sys a, b, wa, wb, cm, c, cw, i
  151. a=1 : b=1
  152. Cols=0 : Rows=0 : ColPad=3
  153. ld=len dlm
  154. if not ld then dlm="," : ld=1 'default to comma
  155. do
  156.  wb=b
  157.  a=instr b,buf,cr
  158.  if a=0 then exit do
  159.  cm=0
  160.  c++
  161.  do
  162.    wa=instr wb,buf,dlm
  163.    if wa=0 or wa>a then exit do
  164.    cm++
  165.    if cm>cols then cols=cm
  166.    cw=wa-wb
  167.    if cw > ColWidth[cm] then ColWidth[cm]=cw
  168.    wb=wa+ld
  169.  end do
  170.  b=a+len cr
  171. end do
  172. rows=c
  173. '
  174. c=0
  175. for i=1 to cols
  176.  ColWidth[ i ]+=ColPad
  177.  c+=ColWidth[ i ]
  178. next
  179. TotWidth=c+len cr
  180. 'print ShowMetrics
  181. end method
  182.  
  183.  
  184. method ShowMetrics() as char*
  185. =============================
  186. sys i
  187. pr="METRICS:" cr cr
  188. pr+=rows tab cols tab totwidth cr cr
  189. pr+="column" tab "spacing" cr
  190. for i=1 to cols
  191.  pr+=i tab ColWidth[ i ] cr
  192. next
  193. return pr
  194. end method
  195.  
  196.  
  197. method justify(char*j)
  198. ======================
  199. jus=j
  200. end method
  201.  
  202. method delimiter(char*j)
  203. ========================
  204. dlm=j
  205. end method
  206.  
  207. method endofline(char*j)
  208. ========================
  209. cr=j
  210. end method
  211.  
  212.  
  213. method layout() as char*
  214. ========================
  215. sys a, b, wa, wb, wl, cm, lpos, cpos, p
  216. bufo=space Rows*TotWidth
  217. a=1 : b=1
  218. do
  219.  wb=b
  220.  a=instr(b,buf,cr)
  221.  if a=0 then exit do
  222.  cm=0
  223.  cpos=1
  224.  do
  225.    wa=instr(wb,buf,dlm)
  226.    if wa=0 or wa>a then exit do
  227.    '
  228.    cm++
  229.    '
  230.    'JUSTIFICATION
  231.    '
  232.    wl=wa-wb
  233.    p=lpos+cpos 'default "L" LEFT ALIGN
  234.    '
  235.    select case asc(jus,cm)
  236.      case "R" : p=lpos+cpos+ColWidth[cm]-wl-Colpad
  237.      case "C" : p=lpos+cpos+( ColWidth[cm]-wl-Colpad )*.5
  238.    end select
  239.    '
  240.    mid bufo,p, mid buf,wb,wl
  241.    cpos+=colwidth[cm]
  242.    wb=wa+ld
  243.  end do
  244.  b=a+len cr
  245.  lpos+=TotWidth
  246.  if lpos<len(bufo) then mid bufo,lpos-1,cr
  247. end do
  248. return bufo
  249. end method
  250. '
  251. end class
  252.  
  253. '#recordof AlignedText
  254.  
  255.  AlignedText atxt
  256.  
  257.  function AlignText(char *in,*ju,*dl,*cr) as char*
  258.  =================================================
  259.  atxt.justify         ju
  260.  atxt.delimiter       dl
  261.  atxt.endofline       cr
  262.  atxt.SetText         in
  263.  return               atxt.layout
  264.  end function
  265.  
  266.  
  267.  sub finish()
  268.  ============
  269.  terminate
  270.  end sub
  271.  
  272.  
  273.  
  274.  function link(sys n) as sys
  275.  ===========================
  276.  select n
  277.  case 0 : return @finish
  278.  case 1 : return @reverse
  279.  case 2 : return @getword
  280.  case 3 : return @aligntext
  281.  end select
  282.  end function
  283.  
  284.  end extern
  285.  
  286.  
  287.  addr link
  288.  """
  289. ' ==============================
  290.  
  291.   '
  292.  a=oxygen(src)
  293.   '
  294.  if (a<>0) then
  295.   '
  296. ' ==============================
  297.  '
  298.  Finish    = dllproc(a,"Finish     ()        ", dllcald(a,0) )
  299.   Reverse   = dllproc(a,"Reverse    (c*value) ", dllcald(a,1) )
  300.   GetWord   = dllproc(a,"GetWord c*=(c*value,i*index) ", dllcald(a,2) )
  301.   AlignText = dllproc(a,"AlignText c*=(c*in,c*jus,c*dlm,c*cr) ", dllcald(a,3) )
  302.   '
  303. ' ==============================
  304.  '
  305.  s="abcdef1234567"
  306.   print "Reversed " & s & " = "
  307.   dllcall(Reverse,s)
  308.   print s & "\n"
  309.   '
  310.  '
  311.  s="one two three"
  312.   i=1
  313.   dllcall(GetWord,s,i)
  314.   print dllcall(GetWord,s,i) & "\n"
  315.   dllcall(GetWord,s,i)
  316.  
  317.  
  318. s="""
  319. Given;;a;;text;;file;;of;;many;;lines,;;where;;fields;;within;;a;;line;;
  320. are;;delineated;;by;;a;;single;;'dollar';;character,;;write;;a;;program
  321. that;;aligns;;each;;column;;of;;fields;;by;;ensuring;;that;;words;;in;;each;;
  322. column;;are;;separated;;by;;at;;least;;one;;space.
  323. Further,;;allow;;for;;each;;word;;in;;a;;column;;to;;be;;either;;left;;
  324. justified,;;right;;justified,;;or;;center;;justified;;within;;its;;column.
  325. """
  326.  
  327.   lf="\n" & chr(0)
  328.   dl=";;"
  329.   fm="LLLLCCCRRRRR"
  330.   ' t=dllcall(AlignText,s,fm,dl,lf )
  331.  t=dllcall(AlignText,s,"LLLLCCCRRRRR",";;","\n" & chr(0) )
  332.   print t & "\n"
  333.  
  334.   dllcall(Finish)
  335.   '
  336.  end if
  337.   dllfile
  338.  

Output


C:\ScriptBasic\examples>sbc dllco2asm.sb
Reversed abcdef1234567 = 7654321fedcba
two

 Given        a            text         file       of       many        lines,        where   fields   within        a   line
 are          delineated   by           a        single   'dollar'    character,      write        a
 that         aligns       each         column     of       fields        by       ensuring     that    words       in   each
 column       are          separated    by         at       least         one
 Further,     allow        for          each      word        in          a          column       to       be   either   left
 justified,   right        justified,   or       center   justified     within          its

C:\ScriptBasic\examples>
99
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 29, 2024, 03:11:02 PM »
This is an example of using the webext extension module to convert a compacted JSON statement to a ScriptBasic associative array. The sbadump() function iis used for debugging to display the the array.

Code: ScriptBasic
  1. IMPORT webext.bas
  2.  
  3. json = """{"id":"0001","type":"donut","name":"Cake","ppu":0.55,"batters":{"batter":[{"id":"1001","type":"Regular"},{"id":"1002","type":"Chocolate"},{"id":"1003","type":"Blueberry"},{"id":"1004","type":"Devil's Food"}]},"topping":[{"id":"5001","type":"None"},{"id":"5002","type":"Glazed"},{"id":"5005","type":"Sugar"},{"id":"5007","type":"Powdered Sugar"},{"id":"5006","type":"Chocolate with Sprinkles"},{"id":"5003","type":"Chocolate"},{"id":"5004","type":"Maple"}]}"""
  4.  
  5. web::json2sba(json)
  6.  
  7. web::sbadump(json)
  8. PRINT "\n\n"
  9. PRINT "Number of batter items:  ", (UBOUND(json{"batters"}{"batter"}) + 1) / 2, "\n"
  10. PRINT "Number of topping items: ", (UBOUND(json{"topping"}) + 1) / 2, "\n\n"
  11.  
  12.  

Formatted JSON
Code: Javascript
  1. {
  2.         "id": "0001",
  3.         "type": "donut",
  4.         "name": "Cake",
  5.         "ppu": 0.55,
  6.         "batters":
  7.                 {
  8.                         "batter":
  9.                                 [
  10.                                         { "id": "1001", "type": "Regular" },
  11.                                         { "id": "1002", "type": "Chocolate" },
  12.                                         { "id": "1003", "type": "Blueberry" },
  13.                                         { "id": "1004", "type": "Devil's Food" }
  14.                                 ]
  15.                 },
  16.         "topping":
  17.                 [
  18.                         { "id": "5001", "type": "None" },
  19.                         { "id": "5002", "type": "Glazed" },
  20.                         { "id": "5005", "type": "Sugar" },
  21.                         { "id": "5007", "type": "Powdered Sugar" },
  22.                         { "id": "5006", "type": "Chocolate with Sprinkles" },
  23.                         { "id": "5003", "type": "Chocolate" },
  24.                         { "id": "5004", "type": "Maple" }
  25.                 ]
  26. }
  27.  

sbadump()
Code: Text
  1. id = 0001
  2. type = donut
  3. name = Cake
  4. ppu = 0.55
  5. batters
  6.    batter
  7.       [1]
  8.          id = 1001
  9.          type = Regular
  10.       [2]
  11.          id = 1002
  12.          type = Chocolate
  13.       [3]
  14.          id = 1003
  15.          type = Blueberry
  16.       [4]
  17.          id = 1004
  18.          type = Devil's Food
  19. topping
  20.    [1]
  21.       id = 5001
  22.       type = None
  23.    [2]
  24.       id = 5002
  25.       type = Glazed
  26.    [3]
  27.       id = 5005
  28.       type = Sugar
  29.    [4]
  30.       id = 5007
  31.       type = Powdered Sugar
  32.    [5]
  33.       id = 5006
  34.       type = Chocolate with Sprinkles
  35.    [6]
  36.       id = 5003
  37.       type = Chocolate
  38.    [7]
  39.       id = 5004
  40.       type = Maple
  41.  
  42.  
  43. Number of batter items:  4
  44. Number of topping items: 7
  45.  
100
ScriptBasic Blog / Re: ScriptBasic 3.0
« Last post by John on March 29, 2024, 12:11:14 PM »
Using libcriba from ScriptBasic or other languages works a little differently than scriba from the console. When you run a script with libscriba, it doesn't destroy the variables created and you can call functions externally using variables defined in the run. You can reset the variables and rerun the script.

I use this feature like an eval function on steroids.
Pages: 1 ... 8 9 [10]