batch and path

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

batch and path

Post by NoahPhense »

batch

Code: Select all

C:\pb\pb4\compilers\pbcompiler %1 /DEBUGGER /UNICODE 
if errorlevel 1 goto error 
C:\pb\pb4\compliers\pbcompiler %1 /DEBUGGER 
if errorlevel 1 goto error 
goto skip 
:error 
pause 
:skip
I've setup a hotkey for this batch in the IDE. It's from here:
http://www.xs4all.nl/~bluez/datatalk/pure5.htm#top

But it's not taking the full path, it's interupted by the spaces in my
paths. What is a good solution for this? I'm thinking of just writing
a small console app instead of using a batch file. ?

- np
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Put double quotes around the %TEMPFILE in the IDE.
Jan Vooijs
Enthusiast
Enthusiast
Posts: 196
Joined: Tue Sep 30, 2003 4:32 pm
Location: The Netherlands

Post by Jan Vooijs »

@NoahPhense,

I notice an error in your batch file (or is it on purpose?)
C:\pb\pb4\compliers\pbcompiler %1 /DEBUGGER
Ieh ?? "\compliers\" ? Should be "\compilers\"

Jan V.
Life goes to Fast, Enjoy!!

PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!

AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

Jan Vooijs wrote:@NoahPhense,

I notice an error in your batch file (or is it on purpose?)
C:\pb\pb4\compliers\pbcompiler %1 /DEBUGGER
Ieh ?? "\compliers" ? Should be "\compilers"

Jan V.
Yeah that was a typo. But wasn't the cause of the path not working.

Because that is in the second half of the batch. The first half was calling
correctly.

I was following these instructions from this bluez page, located here:
http://www.xs4all.nl/~bluez/datatalk/pu ... #2_unicode
; run_unicode.bat
;
compilers\pbcompiler %1 /DEBUGGER /UNICODE
if errorlevel 1 goto error
compilers\pbcompiler %1 /DEBUGGER
if errorlevel 1 goto error
goto skip
:error
pause
:skip

The above would have to be added to the 'tools' and assigned a hotkey in the PB IDE. For that do this:
  • 1. tools / config tools / new
    2. commandline = path + run_unicode.bat
    3. arguments = %FILE
    4. working directory = %PATH
    5. name = whatever you like
    6. menu or shortcut = whatever you like (I use Alt+U)
This works if I change the %FILE to %TEMPFILE, but I can't use it that
way. I need it to RUN from the directory where the actual pb source is
because I have too many additional files, etc..

The problem is when I use just %FILE, it does not handle the spaces
correctly.

i.e.
******************************************
PureBasic v4.00 (Windows - x86)
******************************************

Compiling C:\Documents
The file 'C:\Documents' isn't found or can't be opened !
Loading external libraries...
Error: Syntax error!

Press any key to continue . . .
- np
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

NoahPhense wrote:The problem is when I use just %FILE, it does not handle the spaces
correctly.

i.e.
******************************************
PureBasic v4.00 (Windows - x86)
******************************************

Compiling C:\Documents
The file 'C:\Documents' isn't found or can't be opened !
Loading external libraries...
Error: Syntax error!

Press any key to continue . . .
- np
Uhm maybe you could put Chr(34)+Filename$+Chr(34) into the %FILE variable? I think it's like with the ProgramParameter().
bye,
Daniel
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

DarkDragon wrote:
NoahPhense wrote:The problem is when I use just %FILE, it does not handle the spaces
correctly.

i.e.
******************************************
PureBasic v4.00 (Windows - x86)
******************************************

Compiling C:\Documents
The file 'C:\Documents' isn't found or can't be opened !
Loading external libraries...
Error: Syntax error!

Press any key to continue . . .
- np
Uhm maybe you could put Chr(34)+Filename$+Chr(34) into the %FILE variable? I think it's like with the ProgramParameter().
I could if I were writing a program.. ;)

All I'm trying to do is use this:

Image

- np
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Is it necessary to repeat it? Put double quotes around the %FILE in the IDE.
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Post by Bonne_den_kule »

Code: Select all

"%FILE"
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

Trond wrote:Is it necessary to repeat it? Put double quotes around the %FILE in the IDE.
Thanks Trond, and BDK .. I know this will sound wacked. But I had done
that the first time it was mentioned. But it did not take.

I swear, I'm not losing my mind. Anymore than yesterday anyhow. ;)

Works now.. thanks! Lotta typing for some quotes. (sigh)

- np
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

NoahPhense wrote:
Trond wrote:Is it necessary to repeat it? Put double quotes around the %FILE in the IDE.
Thanks Trond, and BDK .. I know this will sound wacked. But I had done
that the first time it was mentioned. But it did not take.

I swear, I'm not losing my mind. Anymore than yesterday anyhow. ;)

Works now.. thanks! Lotta typing for some quotes. (sigh)

- np
The weirdest thing of all is that I have had the same problem myself. I was sure I had tried with quotes. (But I could be losing my mind).
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

gotta be a ghost ..

- np
Post Reply