let's supposse I have something like this:
Code: Select all
Sub mySub()
Print "hello world!"
End Sub
Dim as string theSubToExec
theSubToExec = "mySub"
Call (theSubToExec)
Is this possible? if possible, how?
many thanks.
Code: Select all
Sub mySub()
Print "hello world!"
End Sub
Dim as string theSubToExec
theSubToExec = "mySub"
Call (theSubToExec)
Code: Select all
Sub mySub()
Print "hello world!"
End Sub
Dim As Sub theSubToExec
theSubToExec = @mySub
theSubToExec()
Code: Select all
Sub mySub()
Print "hello world!"
End Sub
Dim theSubToExec As Sub() = @mySub
theSubToExec()
Yes.Julcar wrote:Another question: can the pointer variable be Dimmed as Shared or stored in an array?
Code: Select all
Sub PrintMSG(ByVal MSG As String)
Print MSG
End Sub
PrintMSG("Hi, there")
PrintMSG("current time: " + Time)
PrintMSG("current date: " + Date)
#Ifdef __FB_PCOS__
Sleep
#endif
is something way more complex (send output based on a env variable) executing an entire program, but I don't want to select-case every possible textMrSwiss wrote:In FB you simply write (procedure) Identifier(argument-list):Code: Select all
Sub PrintMSG(ByVal MSG As String) Print MSG End Sub PrintMSG("Hi, there") PrintMSG("current time: " + Time) PrintMSG("current date: " + Date) #Ifdef __FB_PCOS__ Sleep #endif
How about using a string array instead of a 'endless' select case?Julcar wrote:is something way more complex (send output based on a env variable) executing an entire program, but I don't want to select-case every possible text
Code: Select all
SUB LoadModule (ModuleName AS STRING)
'Main module procedure trigger
SELECT CASE ModuleName
CASE "users"
LoadUsersInterface()
CASE "admin"
LoadAdminPanel()
CASE ELSE
END SELECT
END SUB
Code: Select all
DIM ModuleMainProcedure AS SUB
...
ModuleMainProcedure = ProcPtr(LoadUsersInterface)
...
ModuleMainProcedure()
Well, CMS stands for [C]ontent [M]anagementRoland Chastain wrote:What is the program supposed to do?
MrSwiss wrote:Well, CMS stands for [C]ontent [M]anagementRoland Chastain wrote:What is the program supposed to do?ystem, used on a Web-Server typically.
This lets you easily update "the content served" without changing the code (HTML/CSS/Scripts).
Well, if you have a webhosting account, yo could upload ./index to your public_html/cgi-bin folder and then execute it from any web browser.Roland Chastain wrote:By curiosity, I downloaded your project, compiled it and ran it, without having any idea of what it is. :)
Here is what I get:
[roland@localhost Iguana CMS-7d1a3fe5b0]$ ./index
Content-Type: text/html; Charset=
[roland@localhost Iguana CMS-7d1a3fe5b0]$
What is the program supposed to do?