Page 1 of 1
batch and path
Posted: Sun Sep 10, 2006 4:18 pm
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
Posted: Sun Sep 10, 2006 4:45 pm
by Trond
Put double quotes around the %TEMPFILE in the IDE.
Posted: Mon Sep 11, 2006 2:28 pm
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.
Posted: Mon Sep 11, 2006 2:56 pm
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
Posted: Mon Sep 11, 2006 2:58 pm
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().
Posted: Mon Sep 11, 2006 3:31 pm
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:
- np
Posted: Mon Sep 11, 2006 5:41 pm
by Trond
Is it necessary to repeat it? Put double quotes around the %FILE in the IDE.
Posted: Mon Sep 11, 2006 6:16 pm
by Bonne_den_kule
Posted: Mon Sep 11, 2006 6:24 pm
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
Posted: Mon Sep 11, 2006 7:32 pm
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).
Posted: Mon Sep 11, 2006 10:40 pm
by NoahPhense
gotta be a ghost ..
- np