|
|
|||||||
Hi all, i have 3 simple point i cant program to my own. 1. I have a Question to the User ! ?"How old are you ? example 25 = " 2. This nummber i want to save in a variable. Gets $age 3. Now i want to save this variable in a text or ini file. Here is my main problem, i tried writeline, writeprofilestring and others but nothing happens. It´s possible that my "gets" is wrong ? I´m afraid its a very simple syntax. Thank you for helping me with my first stepps in kix programming. Best regards Gremlin |
||||||||
|
|
|||||||
ok, why don't you post what you have tried? this way we don't feed you with ready code, if you know what I mean |
||||||||
|
|
|||||||
Hello Gremlin and welcome to the board. Please take some time and review the Manual that ships with KiXtart as well as the FAQ section on this board. It should prove to be very helpful in getting you started with KiXtart. Here is an example that you can display in a DOS console window. Then writing to file is easy. Please let us know if you need further assitance. The $age var now holds what ever the user types in until they hit the enter key. However, this code does not check for invalid input but KiX does support validation checking as well. |
||||||||
|
|
|||||||
WOOW this forum works fast *happy* Thank u for helping me. I think i read every fac abaout variable and write in files, but i´m afriad im only a stupid beginner. I dont want i complet programm i think i need only help with the syntax of my programm. here my trys: Please dont laugh My stupid simple script i cant program :/ ?"How old are U ?? example 25 = " Gets $age $file= "t:\age.ini" $rc=WriteProfileString($file, "$age") or WriteLine("t:\age.ini","$age") shame on me :/ best regards Gremlin |
||||||||
|
|
|||||||
Gremlin... relax guy. No one wanting to beat you up for being new and not understanding. Some guys get a little "short on manners" when someone shows or continues to show they don't take the time to read the manual or FAQs. We all had to start out new at some time. Anyways... please take a look at this post for more information on using an INI file. Also, please take the time and read at least some of the FAQs here on Korg. http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=1;t=007101 |
||||||||
|
|
|||||||
Thank u ! I must be blind. The Link works great. now i use a ini file [MyHeader] age= and the script ?"How old are u ? z.B 25 = " Gets $age Break On $File="t:\text.ini" If EXST $File $nul=WRITEPROFILESTRING ("$File", "MyHeader", "age", "$age") ELSE ? 'Unable to locate file '+@ERROR +' '+@SERROR Endif and it works ) Thanks a lot best regards Gremlin |
||||||||
|
|
|||||||
Cool Just a minor note. The "MyHeader" name can be anything you want. It was just an example. For future postings with code please use either the [CODE] Tags to maintain your code layout or PostPrep. There is a link in my signature for PostPrep. Very cool app by Lonkero and Jochen for posting code to Korg. |
||||||||
|
|
|||||||
1. question solved 1000 new questions are open How i write in a blank file . In the moment my file looks like this [CODE] [MyHeader] age=25 but how i get only the 25 in my file ? i tried this-> [CODE] $nul=WRITEPROFILESTRING ("$File", "", "", "$age") but it does´nt work any tips for me ? best regard Gremlin |
||||||||
|
|
|||||||
code: |
||||||||
|
|
|||||||
gremlin, with the code-tags he ment pressing the button and placing your code between the tags |
||||||||
|
|
|||||||
Thank u maciep it works best regards Gremlin |
||||||||
|
|
|||||||
I´m back sorry everything works good but now i have a new problem with my syntax. How i write more as 1 variable in a row split by ",". I try this: code:But program said i need "(".Break On The ini-file should be 25,John,Houston, `cause i wanted to make a xls evaluation. Hope this is my last question for this week, but i believe i will be back soon. best regards Gremlin |
||||||||
|
|
|||||||
quess you should read some of the manual or the starters guide in faq... over even try out... anyway: code:cheers$nul = writeline(1, $age + "," + $name + "," + $city + @crlf) |
||||||||
|
|
|||||||
btw, as you still keep talking about ini, you should not use writeline but writeprofilestring. |
||||||||
|
|
|||||||
Or use a txt file instead of an ini. All depends on what you want. |