I got this error:
error: Uncaught ReferenceError: PB_Requester_MultiSelection is not defined...
Also, The "Copy Log" feature does not work. Have to type from what I see.
// Moved from "Bugs Reports" to "Coding Questions" (Peter)
File.sb example
Re: File.sb example
I cannot confirm this. It works as expected (SpiderBasic V3.02)error: Uncaught ReferenceError: PB_Requester_MultiSelection is not defined...
Requester.sb:
Code: Select all
; ------------------------------------------------------------
;
; SpiderBasic - Requester example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
Procedure RequesterSuccess()
; Process all the selected filename
;
While NextSelectedFile()
Debug SelectedFileName()
Wend
EndProcedure
Procedure ButtonEvent()
OpenFileRequester("", @RequesterSuccess(), #PB_Requester_MultiSelection)
EndProcedure
If OpenWindow(0, 100, 100, 200, 45, "File")
ButtonGadget(0, 10, 10, 180, 25, "Open local file(s)...")
BindGadgetEvent(0, @ButtonEvent())
EndIf
I cannot confirm this either.Also, The "Copy Log" feature does not work. Have to type from what I see.
-
- Posts: 4
- Joined: Mon Mar 17, 2025 9:20 am
Re: File.sb example
I guess he's talking about this example (file.sb)
But it works as expected, and there is no #PB_Requester_MultiSelection either...
Code: Select all
;
; ------------------------------------------------------------
;
; SpiderBasic - File example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
Procedure ReadCallback(Status, Filename$, File, Size)
If Status = #PB_Status_Loaded
Debug "File: " + Filename$ + " - Size: " + Size + " bytes"
Debug "Reading first 3 lines:"
; Read the first 3 lines
;
While Eof(0) = 0 And NbLine < 3
Debug ReadString(0)
NbLine+1
Wend
CloseFile(0)
ElseIf Status = #PB_Status_Error
Debug "Error when loading the file: " + Filename$
EndIf
EndProcedure
Procedure OpenFileRequesterCallback()
If NextSelectedFile()
ReadFile(0, SelectedFileID(), @ReadCallback(), #PB_LocalFile)
EndIf
EndProcedure
Procedure ChooseFileEvent()
OpenFileRequester("text/plain", @OpenFileRequesterCallback())
EndProcedure
OpenWindow(0, 0, 0, 300, 50, "Read file example", #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 280, 30, "Choose a text file...")
BindGadgetEvent(0, @ChooseFileEvent())
Re: File.sb example
I am using 3.02. I am trying to see how to handle local files. I can create it but when I read it it always reads the cached values. I cannot find where to clear the cache.
Re: File.sb example
here's a screen shot of what i mean... and if you right click where the white arrow is and select Copy Log, nothing is copied.
https://www.sendspace.com/file/155mz2
https://www.sendspace.com/file/155mz2