Beginnersquestion: Some listings don't start running

Just starting out? Need help? Post your questions and find answers here.
Rudy M
User
User
Posts: 46
Joined: Fri Aug 23, 2024 1:18 pm

Beginnersquestion: Some listings don't start running

Post 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
User avatar
SPH
Enthusiast
Enthusiast
Posts: 640
Joined: Tue Jan 04, 2011 6:21 pm

Re: Beginnersquestion: Some listings don't start running

Post by SPH »

Here, it's ok for me ! :!:

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
HeX0R
Addict
Addict
Posts: 1258
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Beginnersquestion: Some listings don't start running

Post 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.
User avatar
mk-soft
Always Here
Always Here
Posts: 6607
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Beginnersquestion: Some listings don't start running

Post by mk-soft »

Whats OS and Compiler Option -> Execute Format -> Console
My Projects EventDesigner V3 / ThreadToGUI / OOP-BaseClass / Windows: Module ActiveScript
PB v3.30 / v5.75 - OS Mac Mini - VM Window Pro / Linux Ubuntu
Downloads on my OneDrive
JHPJHP
Addict
Addict
Posts: 2285
Joined: Sat Oct 09, 2010 3:47 am

Re: Beginnersquestion: Some listings don't start running

Post 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$)
Rudy M
User
User
Posts: 46
Joined: Fri Aug 23, 2024 1:18 pm

Re: Beginnersquestion: Some listings don't start running

Post 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
Post Reply