Main Menu

Custom File Request

Started by kevin, November 21, 2003, 11:52:42 AM

Previous topic - Next topic

kevin

Here's the version first public demo produced with  Play Basic V1.64 (alpha).  This demo (a custom file requester/dialog) was ported from old DB/DBpro code written by INDI,DAVID89 and Sampa, although to be honest, I've pretty much re-written it entirely.  Anyway, it should give you fairly good example of how the code looks, and the type of file system commands that are already built  into the language for speed.

 While Play Basic is interpreted, this version  actually outperforms the original DB/DBpro versions.   If you examine the code, you'll no doubt see one key features of the language, and that's passing arrays/types by reference.

 This ability means that functions no longer become 'tied' to arrays.  So one function can be used on any array of the same input type (data).  So things like the simple button library i've wedged into this demo at the bottom, or even the file requester it self could have multiple instances in difference arrays, all using the same set of functions.

 If your not familiar with this, here's a small example.



 Dim Table(100)
 Dim AnotherTable(1000)
; Call our Fill Array Fucntion, Pass it the Data (handle) of the TABLE() array
 FillMyArray Table(),999
; Call our Fill Array Fucntion, Pass it the Data (handle) of the ANOTERTABLE() array
 FillMyArray AnotherTable(),999

 print "Now Both Tables Have been filled with the value 999"
showscreen
waitkey

end
 

Function FillMyArray(PassedArray(),FillValue)
Size=Get_array_elements(PassedArray(),1)
For lp=0 to size
  PassedArray(lp)=FillValue
next
endFunction





 Anyway, welcome to PlayBASIC


Download
========

Download Play Basic File Request Demo (login required)    (650K)