Just got stuck when I tried to extract data from my textentries. For exemple, I extract informations from a config files to display and I want to be able to set a value accordingly to the informations given.
Sorry for the visual exemple:
-------------------------------------
-
- MyName (TextEntry)
- MyLastName (TextEntry )
- My Favorite Color ( TextEntry)
-
-------------------------------------
Code:
var config := ReadConfigFile( ":Main:Players" );
var elem := config["Settings"];
var script_list := GetConfigStringArray( elem, "Elem" );
var num_options := script_list.Size();
var y_pos := 110;
foreach entry in ( script_list )
GFTextLine( gump, 45, y_pos, 1153, entry );
GFResizePic( gump, 250, y_pos, GFGetCfgConst("Backgrounds", "GOLDTRIM" ), 190, 28 );
GFTextEntry( gump, 255, y_pos+4, 190, 28, 2100 );
y_pos += 20;
SleepMS(2);
endforeach
The main idea is to extract the GFTextEntry into an array and then I can save all the data in a new config file. The next exemple doesn't work and I'm wondering why:
Code:
var config := ReadConfigFile( ":Main:Players" );
var elem := config["Settings"];
var script_list := GetConfigStringArray( elem, "Elem" );
var data := array;
var y_pos := 110;
foreach entry in ( script_list )
GFTextLine( gump, 45, y_pos, 1153, entry );
GFResizePic( gump, 250, y_pos, GFGetCfgConst("Backgrounds", "GOLDTRIM" ), 190, 28 );
data.append( GFTextEntry( gump, 255, y_pos+4, 190, 28, 2100 ));
y_pos += 20;
SleepMS(2);
endforeach
var input := GFSendGump( mobile, gump );
var result := GFExtractData( input, Data );
Broadcast( result );
I'm getting an error with result... at the moment I extract the text entries I will be alright but now I'm stuck.
Edited: From one side I understand why my "append()" doesn't work but I can't think of a way to extract it. In other words, I want to extract all the GFTextEntry for reading.