Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Unwanted Duplicate Data in Text Fields

From: rotenca:telvia:it at: 7-Nov-2003 19:50

Hi Ted,
> In the code below, after I click "Load", if I immediately enter text in the > 3rd text field, and then click "Forward" the text is not inserted into 'db. > However, if I click "Load", then immediately click "Forward" any number of > times, and then enter text into the 3rd or 4th text fields, the 3rd and 4th > fields of all records will immediately be set to the value entered. What is > happening?
The problem here is that after you call Forward the database and the field use the SAME string (at the same memory location), so when you change the field string you are also changing the database string. But before you call Forward, some of the field string and the database strings are different string (=stored in different memory locations). When you Load the database, you assign the same string of the database only at these 2 fields:
> f1/text: db/1/1 > f2/text: db/1/2
When you click Forward, you assign the same string of the database at all the fields. I do not think that sharing strings between fields and database is a good idea, but i can be wrong. --- Ciao Romano