-
Noob needs help
Hello everyone. I hope I may ask that in this forum. I've downloaded MMF2D this morning and played with it a bit for a while.
First of all I like how easily you can design applications. But I cannot complete the "coding-part".
Can anyone please help? I need to know how to save a couple of information (maybe in a textfile or database, doesnt matter).
After that I have a dropdown menu. In this menu only one information [the name] is listed. On change all other information should be displayed.
Can anyone please tell me how to do this?
Thank you so much [+ sry for my bad English ;)]
-
Re: Noob needs help
Well there are different ways to save data. Most extensions that contain an array of some sort also have a save-to-disk feature.
So chose the one you like best for storing information, enter that and then you can save and load it. There's also an extension to check whether a file exists (file extension or so) one for load/save dialog boxes.
For lots of information you probably need a loop that runs through the array that contains the information and adds each line to the dropdown menu that is different to "".
-
Re: Noob needs help
Sorry, I still don't know how to do it :-( First I create a ODBC object. Then I can select a textfile/ database etc. Well, i choose a excel file. Then i go to the event editor. It know says I can add a sql query. Okay, I typed "INSERT INTO" .. but now what?
I think I did almost everything wrong. Pls tell me how to store information in a database/ textfile etc.
Sorry, I really don't get it :-(
-
Re: Noob needs help
ODBC isnt the easiest of things to get working without alittle bit of help :) and also knowing the relevant SQL syntax for the file that you are using.
I personally would use array to store data as its much easier, only use ODBC when you really need to.
Jason
-
Re: Noob needs help
Okay, thank you thank you thank you. :)
I can save and load arrays to files now but if I save my array like this
VALUE[nameoffield1]+"~"+VALUE[nameoffield2] to 0
how can i just get array[0][0] then (the value of field1)?
Or do I think too complicated *glugg*
Bye and thanks for the great support so far
-
Re: Noob needs help
To use array the normal process is one of two ways i guess.
1. If you intend to save to a file.
Load the Array file
Write values to the array file
Save the array file
2. If you intend to use the array as temp storage for the running time only of the program.
Write the values to the array file
Either way you would then read the array position.
If you are using a single array dimension then you just specify one position (eg like you have) of course make sure you have specified either a 0 based index or 1 based index. This will make a big difference as a 0 based index starts from "0" and 1 starts from "1". So if you are using 1 and trying to read from 0 it wont work.
Also the array can hold numbers or text only, this needs to be specified in the object properties.
To write a value or string, select the relevant action of "Write String" or "Write value" to X etc.
Jason
-
Re: Noob needs help
Okay thank you a lot for this short tutorial. But I still don'T know if it's possible to seperate a string saved in an array.
If it isn't is there a way to save a lot of information to an array belonging to one dataset
for example:
Username:
real name
birthdate
country
etc..
If I want to print all these infomation now if the username is selected in a dropdown menu....how can I do that? :-(
-
Re: Noob needs help
Maybe you should try using an .ini file.
Theres a tutorial on how to use ini's and the ini object in the link below.
http://www.clickteam.com/eng/learning_resources.php
-
Re: Noob needs help
The way to separate strings and numbers in an array, is to have two arrays ;) one which contains text and the second which contains numbers.
Heres how you would do it based on your dataset.
First create two arrays, one numeric and the other string. These should be two dimensional arrays, using X & Y.
The equate each X number in the array as a different dataset person.
So
Text Array x[1]
Username = fred [y1]
Realname = freddy [y2]
Country = UK [y3]
Using the second array in the same X position you would then put the numeric information
Number Array x[1]
Birthday = 28 [y1]
etc etc...
So you have 5 users on x1,x2,x3,x4, and x5. call the specific user and then call its data from the specific positions in the Y array positions.
Hope that makes sense?
Jason
-
Re: Noob needs help
thank you that helped. I'm almost able to do what I wanted. But you can't load information from an ini file if you dont know the group, can you?
I need to fill out a combobox with the usernames of all users. If I save to an ini file like this
[user1]
uname=user1
[user2]
uname=user2
[user3]
uname=user3
That isn't possible, is it?