|
Post by dw817 on Apr 21, 2009 21:23:09 GMT -5
Hello: * I wanted to see if there was a way you could call a shell in B4GL. So you could do something like: shell("copy file1.gb file2.gb") or shell("dir/on>dir.txt") And you would copy a file or create a text file showing you a directory with full details alphabetically. For more complex stuff you could do like the demo I have below, all done from the command line (cmd.exe) through a shell. Simple Video Player www.mediafire.com/download.php?m1ztgodkjno
|
|
|
Post by UNDISCLOSED on Apr 22, 2009 13:27:32 GMT -5
You can use toolbox.dll to run a batch file I think, wait and I will try... Yup. and for coping files just use DIM File1 = openFileRead("File1.gb") DIM File2 = openFileWrite("File2.gb") DIM BYTE
While EndOfFile() = FALSE WriteByte(File2, BYTE) BYTE = ReadByte(File1) WEnd
This should work but I have not tested it.
|
|
|
Post by dw817 on Apr 22, 2009 14:23:52 GMT -5
Hi Wolfman:
* Nono..
I want to be able to run a virtual shell; copying a file is just one thing you can do. You can also call PKZIP and PKUNZIP, or get a copy of your entire hard-drive with:
Shell("dir\/os>dir.txt")
Stuff like that. . . .
I'm working in GFA right now to make a bundler, will take single compiled B4GL EXE and tag on the end of it all the DLLs in the same directory, leaving it still a single EXE. Will be a bit of work but I can see this will be desired by B4GL programmers for final release of their EXEs.
|
|
|
Post by UNDISCLOSED on Apr 22, 2009 15:22:04 GMT -5
Yes, but you can do all that from a batch file no?
|
|
|
Post by dw817 on Apr 22, 2009 16:31:55 GMT -5
I don't know, Wolfman.
Can you post an example please with batch file process ?
|
|
|
Post by UNDISCLOSED on Apr 23, 2009 10:08:18 GMT -5
Example:
@REM This is a comment. @REM The '@' Simply tells CMD not to show the user this propt (This is called command echoing.) @REM Permanently turn off command echo, it can be turned on by @ECHO ON or just ECHO ON. @ECHO OFF REM Print Hello World to the CMD console, For a blank line just put ECHO. ECHO Hello World
REM Now pretty much anything you can type into the windows Command prompt can be put here. REM Plus some extra stuff, just google for 'Windows Batch file tutorial'. REM Pause for the user: PAUSE
REM End execution: EXIT
Its not case sensitive and its raely easy to do.
|
|
|
Post by dw817 on Apr 28, 2009 20:00:47 GMT -5
Hi Wolfman:
* Nono.. I meant with B4GL, how do you do a DOSHELL command like "dir>dir.txt" in there ?
|
|
|
Post by UNDISCLOSED on Apr 29, 2009 7:37:01 GMT -5
The shell commands work in MS-BATCH Files, you just need toolbox.dll to execute the batch file:
i.e.
The batch file (FILE.BAT):
@ECHO OFF dir>dir.txt
The .gb file:
executeprogram("FILE.BAT")
is the same as doing SHELL("dir>dir.txt") if FreeBASIC.
|
|
|
Post by dw817 on Apr 29, 2009 8:05:42 GMT -5
Ah, executeprogram() is the command to call. Okay, this is what I needed to know; thanks !
|
|
|
Post by UNDISCLOSED on May 11, 2009 10:49:34 GMT -5
|
|