Page 1 of 1

Beginnersquestion: Some listings don't start running

Posted: Mon Nov 25, 2024 9:48 pm
by Rudy M
Hello,
I'm still exploring Purebasic.
In the beginnerguide I saw this little testlisting, but it does not run. It does nothing, also gives no error?

Is there something I'm doing wrong?

Thanks,
Rudy M

Code: Select all

If OpenConsole()
  PrintN("1. Official PureBasic Home")
  PrintN("2. Official PureBasic Forums")
  PrintN("3. PureArea.net")
  PrintN("")
  PrintN("Enter a number from 1 To 3 and press Return: ")
  Destination.s = Input()
  
  Select Destination   
    Case "1"
      RunProgram("http://www.purebasic.com")
    Case "2"
      RunProgram("http://forums.purebasic.com")
    Case "3"
      RunProgram("http://www.purearea.net")
  EndSelect
EndIf
End

Re: Beginnersquestion: Some listings don't start running

Posted: Mon Nov 25, 2024 9:55 pm
by SPH
Here, it's ok for me ! :!:

Re: Beginnersquestion: Some listings don't start running

Posted: Mon Nov 25, 2024 9:57 pm
by HeX0R
He works with Linux as far as I can see in his other posts, there, if I remember correctly, it is a must to set the executable format to console (in compiler options) when tinkering with the console output.

Re: Beginnersquestion: Some listings don't start running

Posted: Mon Nov 25, 2024 10:00 pm
by mk-soft
Whats OS and Compiler Option -> Execute Format -> Console

Re: Beginnersquestion: Some listings don't start running

Posted: Mon Nov 25, 2024 10:42 pm
by JHPJHP
Hi Rudy M,

Welcome to PureBasic.

When I had access to Linux (it's been a couple years), I needed the following to open a webpage using RunProgram:

Code: Select all

RunProgram("xdg-open", "http://www.purebasic.com", #Null$)
For OSX I used the following:

Code: Select all

RunProgram("open", "http://www.purebasic.com", #Null$)

Re: Beginnersquestion: Some listings don't start running

Posted: Tue Nov 26, 2024 5:51 pm
by Rudy M
Sorry for my late reaction.

@HeX0R: Yes, I work with Linux Mint

@JHPJHP: Thanks, I'm going to test your tip or hint.


I think its the combination of the new IDE (for me!) AND the difference with my former compilers.

Switching from Basic PDS and FreeBasic to PureBasic is not as simple as it may seem at first glance.

It'll be okay (with ups and downs) :D :D :D