Author Topic: Re: Let's go to the barn  (Read 963 times)

0 Members and 1 Guest are viewing this topic.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Let's go to the barn
« on: July 14, 2018, 02:14:13 pm »
:-D Yes, this is nice!

I test the system as follows:
Code: QB64: [Select]
  1. IF INSTR(_OS$, "LINUX") THEN OS = 1 ELSE OS = 0
  2.     CASE 1
  3.         'Linux Path:
  4.         Path = "./"
  5.     CASE 0
  6.         'Windows Path:
  7.         Path = ".\"
  8.  

FellippeHeitor

  • Guest
Re: Let's go to the barn
« Reply #1 on: July 14, 2018, 02:25:16 pm »
You can also:
Code: QB64: [Select]
  1. $IF WIN THEN
  2.     Path = ".\"
  3.     Path = "./"

The reality is that it makes no difference for QB64's statements if you use / or \, no matter the operating system. Statements like OPEN, and others that deal with files, just don't care and work the same whether you pass them a path with \ or / as separators.

You must only worry about separators if you use SHELL.
« Last Edit: July 14, 2018, 02:26:27 pm by FellippeHeitor »