|
Answer» I would like to get a specific line into a text file to USE it like a configuration file, but how do i get these chars and i save them in a var? I want something like that, it's a ini file, but it could be a txt file. It could be the whole txt file, cause i've got only 1 stuff to save, like this :
Config.ini{
MyData
}
//My data is text that the user can modify using notapad or edit function, but i just would like to be able to load it and put it in a var such as %Data%.
//I know that my label names aren't clear, but they are using a easy hierarchy cause it's a menu system like : [a] [aa] [aaa] [aab] [ab] [ac] [aca] [acb]
MyBat.bat{ [...] REM This is options menu... :ab cls echo ===== echo Config menu echo ===== echo. 1) Edit Config.ini 2) Replace Config.ini by default configuration 3) Back choice /n/c:123 Selection?: if errorlevel == 1 edit Config.ini if errorlevel == 2 echo MyData>Config.ini if errorlevel == 3 goto a [...] REM A function where i actually need to configuaration... :ac echo ===== echo Reinitialize echo ===== echo. echo 1) Reinitialize the selected drive echo 2) Back choice /n/c:12 Selection?: if errorlevel == 1 format a: /v:%Data%/s if errorlevel == 2 goto a [...] }
//I know that it's a unuseful thing, but i also want to make a larger configuration (If i could ... ). As i said before, i would like to be able to have only 1 file for all config, but if i need to use 100 hundred files with one thing in each, i will do it.
Thank you for the one that will help me ...Look at AviT's query below entitled "Copy a row from file to file"
It that's what you mean, you can see the only answers we know.
Mac That's something like this, but could you explain your script... If i've that much difficult, it's that i am more a DHTML, JS, HTML, CSS, PHP and high degree script used to work with. Batch is so... Basic i have diffucult to work with command that aren't flexibles like c++ cause i worked on c++ before now i am c# but it was more powerful now, i would just know Qbasic is included directly in the MS-DOS shell, or it is a external application, cause i'm doing a "program" that will work on a low resources computer such as Win 98 and maybe at the boot setup... I have the room of a disket. 1.44 Mo and almost all is used for MS-DOS, so if it's not included or compatible with Win98.
The fact, is i need to store the value in a var instead of appending it to another text file, append i know how to do is just to read a specific line and to store it in a var to be used.
config.bas { Config.bas CONST File1 = "z1.txt"' This is the file w/many lines CONST File2 = "z2.txt"' This is the file you want to add one to. OPEN File1 FOR INPUT AS #1 LINE INPUT #1, l$ CLOSE OPEN File2 FOR APPEND AS #2 PRINT #2, l$ CLOSE SYSTEM }
//This code is COPYING a line from file 1 that is stored in l$ and pasted into file 2, right? So could i get the %l and use it with ms-dos, or do something like in php: (Attachment)
I hope you can understand
Thank you so much or help!Try this and tell me what happens - at the DOS prompt, enter "QBasic"
You should see a Welcome-to-QBasic message. Ignore the stupid, useless "Survival Guide". Instead, press ESC
You should see a blank blue SCREEN. You can learn instructions by using HELP/Index
Anyway, at the blank screen, enter PRINT "Hello" and click on Run/Start.
You did it! You just wrote and tested your first QBasic program.
Now after PRINT "Hello", enter SYSTEM. Your program:
PRINT "Hello" SYSTEM
You could run it again, but it would just do the same thing. SYSTEM doesn't do anything except flag the end of your program, which is useful in batch applications.
Now do File/Save In the File Name box, enter a name for your program, such as "MyFirst" Now do File/Exit
OK, last test. At the DOS prompt, enter QBasic /run MyFirst
Did it print "Hello" as expected?
MacAyay, yo tengo un problema!
Is QBasic available on a Win9x? Because, in the DOS windows, i do this:
C:\WINDOWS>QBasic //I press enter Commande ou non de fichier incorrect //That means something like this : Command or file name (incorrect or unknown)
So is it because Win98 se doesn't contain QBasic, or it's cause i misspelled it? If it's not included, could you give me the files for it in a zip... Because i would like to get them... Elsewhere i will need to download a c++ compiler because i lost my hard drive.Go to the QBasic Forum Community home page http://www.network54.com/Index/10167
Click on "Links and Downloads"
Click on QBasic 1.0
There is a nice QBasic How-To on that page, too.
Mac Ok, i will download it (i just don't do it now cause i'm making à c# application for someone) but, you still hasn't explained your script... I need to FINISH my c# application during this week-end so... i would like you to explain me or do the QBasic script for me please. Thank you very much i would be losing time in a c++ application without you!
Quote Ayay, yo tengo un problema!
Is QBasic available on a Win9x? Because, in the DOS windows, i do this:
C:\WINDOWS>QBasic //I press enter Commande ou non de fichier incorrect //That means something like this : Command or file name (incorrect or unknown)
So is it because Win98 se doesn't contain QBasic, or it's cause i misspelled it? If it's not included, could you give me the files for it in a zip... Because i would like to get them... Elsewhere i will need to download a c++ compiler because i lost my hard drive.
Qbasic can be found in Win95 at \OTHER\OLDMSDOS and for Win98 at \TOOLS\OLDMSDOS For later versions of Windows, you can use vbscript/wsh .... sorry i don't understand what u r trying to do, so couldn't help much.
Okay, okay, but where does i find
QuoteQbasic can be found in Win95 at \OTHER\OLDMSDOS and for Win98 at \TOOLS\OLDMSDOS
because when i type QBasic at DOS prompt, it just says that it's an unknown command...
QuoteOkay, okay, but where does i find
QuoteQbasic can be found in Win95 at \OTHER\OLDMSDOS and for Win98 at \TOOLS\OLDMSDOS
because when i type QBasic at DOS prompt, it just says that it's an unknown command...
Its from the CD..Okay!!! Thank you, i'm gonna look...Your stuffs aren't doing exactly what i wish (in qbasic) cause i want to get the data with ms-dos, not append in a log i can do it in dos!!!
|