Page 1 of 3

SpiderBasic 4.00 beta 1 is out !

Posted: Mon May 25, 2026 12:21 pm
by Fred
Hi folks,

- 2026-06-22: 4.00 beta 1 is out, with the whole doc finished, and full local file support on Android and iOS. Bumped to 4.00 due to heavy syntax changed and more BASIC like program flow without relying on callbacks.

Code: Select all

 - Android Cordova updated to v15 and Android SDK to v36
- 2026-05-27: beta 2 is out, with some bug fixes, and a new DateUTC() function.

Here is the new 3.30 beta version of SpiderBasic introducing a nice new feature we wanted to implement since a while: async/await support. What does it means for you ? Less callbacks ! The commands can finally wait for there execution to finish and you can code in a more linear fashion.

For example, using the OpenFileRequester() to display a local image was looking like that:

Code: Select all

Procedure Loaded(Type, Filename$, ObjectId)
  Static x = 200, y = 200
  
  OpenWindow(#PB_Any, x, y, 300, 300, Filename$, #PB_Window_TitleBar | #PB_Window_SizeGadget)
    ImageGadget(#PB_Any, 0, 0, ImageWidth(ObjectId), ImageHeight(ObjectId), ImageID(ObjectId))
    
  ; Shift the next opened window
  ;
  x + 40 
  y + 40
EndProcedure


Procedure LoadingError(Type, Filename$)
  Debug Filename$ + ": loading error"
EndProcedure

 
Procedure RequesterSuccess()
  
  ; Process all the selected filename
  ;
  While NextSelectedFile()
    LoadImage(#PB_Any, SelectedFileID(), #PB_LocalFile) ; when using #PB_LocalFile, all files selected with OpenFileRequester() are directly available
    Filename$ = SelectedFileName()
  Wend
  
EndProcedure

Procedure ButtonEvent()
  OpenFileRequester("image/*", @RequesterSuccess(), #PB_Requester_MultiSelection)
EndProcedure


OpenWindow(0, 100, 100, 200, 45, "Image viewer", #PB_Window_TitleBar)
ButtonGadget(0, 10, 10, 180, 25, "Open local image...")
BindGadgetEvent(0, @ButtonEvent())

; Register the loading event before calling any resource load command
BindEvent(#PB_Event_Loading, @Loaded())
BindEvent(#PB_Event_LoadingError, @LoadingError())
Now, the same code using async under the hood makes the code easier to follow and more PureBasic-like

Code: Select all

Procedure ButtonEvent()
  x = 200
  y = 200
  
  Filename$ = OpenFileRequester("image/*", #PB_Requester_MultiSelection)
  
  ; Process all the selected filename
  ;
  While Filename$
    Image = LoadImage(#PB_Any, Filename$, #PB_LocalFile) ; when using #PB_LocalFile, all files selected with OpenFileRequester() are directly available
    If Image
        
      OpenWindow(#PB_Any, x, y, 300, 300, Filename$, #PB_Window_TitleBar | #PB_Window_SizeGadget)
        ImageGadget(#PB_Any, 0, 0, ImageWidth(Image), ImageHeight(Image), ImageID(Image))
    
      ; Shift the next opened window
      ;
      x + 40 
      y + 40
    EndIf
    
    Filename$ = NextSelectedFilename()
  Wend
EndProcedure

OpenWindow(0, 100, 100, 200, 45, "Image viewer", #PB_Window_TitleBar)
ButtonGadget(0, 10, 10, 180, 25, "Open local images...")
BindGadgetEvent(0, @ButtonEvent())
This is early work on this and if it works well it be done for the whole commandset. I tested on cordova and it works as expected, but feel free to test and see if it is OK.

The modified affected commands which now uses await:

Code: Select all

CaptureImage()
CloseFile()
CopyFile()
CreateDirectory()
DeleteDirectory()
DeleteFile()
ExamineDirectory()
FetchData()
FileSize()
GetFileAttributes()
GetFileDate()
HTTPRequest()
LoadImage()
LoadJSON()
LoadScript()
LoadSound()
LoadSprite()
LoadXML()
OpenFileRequester()
ReadFile()
RequestFileSystem()
SetCurrentDirectory()
That means that these commands doesn't need a callback anymore and will returns the result directly when the processing is done, actually blocking the program flow.

Here is the change list for this version:

Code: Select all

  - Added: async/await support for most of the commands, callbacks are now optionals and program flow easier to follow !
  - Added: FileSystem library to easily act on local files (iOS, Android only)
  - Added: Preference library using local storage based on Peter's work (Thanks ! https://github.com/spiderbytes/Preferences)
  - Added: CaptureImage() to get an image from the camera (iOS, Android only)
  - Added: CreatePasswordHash() and VerifyPasswordHash() based on bcrypt
  
  - Optimized: Splitted the system library to not have all cordova libs included when using a single command
  - Optimized: Android app creation should be much faster on Windows
  
  - Changed: NextSelectedFile() to NextSelectedFileName()
  - Removed SelectedFileName() and SelectedFileID()
Have fun !

The Fantaisie Software team

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Mon May 25, 2026 3:17 pm
by hoerbie
Hi @Fred,
is there any general download problem for the new beta?
Because I can't find any beta downloads when logging in, although my license is paid until october 26?
Greets, hoerbie

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Tue May 26, 2026 6:23 am
by Danilo
Sounds good, and will make SpiderBasic easier to use! 🙏🏻

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Tue May 26, 2026 9:22 am
by Fred
hoerbie wrote: Mon May 25, 2026 3:17 pm Hi @Fred,
is there any general download problem for the new beta?
Because I can't find any beta downloads when logging in, although my license is paid until october 26?
Greets, hoerbie
I will take a closer look

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Tue May 26, 2026 10:02 am
by Peter
hoerbie wrote: Mon May 25, 2026 3:17 pmBecause I can't find any beta downloads when logging in
same here.

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Tue May 26, 2026 11:25 am
by Fred
I probably forgot to click on the deploy button :D. It's too hot here to work

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Tue May 26, 2026 3:00 pm
by Peter
Fred wrote: Tue May 26, 2026 11:25 am I probably forgot to click on the deploy button :D
No problem! Let me know when you've done it.

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Wed May 27, 2026 6:40 am
by Fred
Should be better

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Wed May 27, 2026 7:14 am
by Peter
Fred wrote: Wed May 27, 2026 6:40 amShould be better
👍

Re: SpiderBasic 3.30 beta 1 is out !

Posted: Wed May 27, 2026 7:17 am
by Danilo
Thanks! All interface examples crash now. It says compiler crash.
Did interfaces change internally, or is it really a compiler crash with interfaces?

Any access to an interface member says compiler crash: txt1\Get()