The Daily Click ::. Forums ::. Klik Coding Help ::. Edit my Array

Post Reply  Post Oekaki 

Posted By Message



VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
23rd September, 2009 at 10:11:43 -


I have created a call logging system which saves all the details into an array file. this all appeared to work until today.

my array stores the data using a single string for each call and then each string is split up using the string tokenizer. The problem i have is that some of the fields in the system were not being completed and this resulted in two of the delimeters used by the tokenizer being placed next to each other. I am now unable to read the values in the array correctly as some of the entries are out of sync.

I need to edit the array so that the delimeters next to each other now have a " " in them.

anybody got any ideas? I have already tried to use the editors on this site with no luck. My array entries look like this

Name€Room€Details€Date Logged€Date Closed€Resolution€Status

The broken ones read:

Name€€Details€Date Logged€Date Closed€Resolution€Status

I need to place a space in where room should be to fix this. Hope this makes sense to everyone.





The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
23rd September, 2009 at 11:23:48 -

Couldn't you just start all of your alterable strings as " " instead of "".

And if the data can be manualy edited and you fear it could get back to "" ...
if Alterable String A( "Active" ) = ""
Set Alterable String A to " "


Don Luciano

Heavy combat pancake


VIP Member
23rd September, 2009 at 13:04:32 -

You can edit array in game, with debugger. Then just save it. I m not really sure what you want...

Edited by Don Luciano

Code me a sausage!


Cornwall UK


VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
23rd September, 2009 at 14:19:14 -

You could make a simple little program to replace "€€" with "€ €" automatically, using the "substring replace" extension.

+ Start of frame
-> Load array...
-> Start fastloop "Fix Array", DimX("Array") * DimY("Array") times.

+ On loop "Fix Array"
-> Array: Set string at...

String to Write = ReplaceSubstring$( "Substring Replace", StrAtXY( "Array", LoopIndex("Fix Array") mod DimX( "Array" ), LoopIndex("Fix Array")/DimX( "Array" )), "€€", "€ €")

X Index = LoopIndex("Fix Array") mod DimX( "Array" )

Y Index = LoopIndex("Fix Array") / DimX( "Array" )

+ Run this event once
-> Save array...

Or you could use the dynamic array extension to export the contents of the array as a .csv file, and then manually edit it in Excel or Notepad.

I never knew you could edit arrays using the debugger - how useful
If you have MMF2Dev, the Datagrid extension would be even better though.

Edited by Sketchy



24th September, 2009 at 02:12:17 -

or use a ; symbol like most other programming langauges




VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
24th September, 2009 at 09:49:37 -

Thanks sketchy, i'll look into this. For those of you who were unsure:

I have got an array full of data already however some of the items are being misread by my application as the delimiters i am using in the array data are next to each other and thus not being picked up. I can't use ; as this could be a character used in the data being stored that is why i went for something obscure like €.


Post Reply



Worth A Click