PB Structure Loading

PB Structure Loading

Post by april.wiac » Fri, 22 Aug 2003 10:05:59


I have a database table which contains 2 varchar(255) fields
identifying 2 structure/element[array], serving as a cross reference.
My goal is to take the value already loaded into one structure and
load it into the cross referenced structure.
For example:
VarcharField_1 value = str_parms.integer_arg[1]'
VarcharField_2 value = str2_parms.integer_arg[3]'

I want to be able to use these table field values to accomplish this
statement:

Istr2_parms.integer_arg[3] = Istr_parms.integer_arg[1]

Resulting in Istr2_parms structure being loaded with the value in the
indicated Istr_parms structure.

Any ideas on how to accomplish this?
 
 
 

1. structures, structures and more structures (questions about nested structures)

2. pickle.load() on an dictionary of dictionaries doesn't load full data structure on first call


In general it's a bad idea to point the list to a full. It's usually
wiser to deduce the issue to a relatively small, easily runnable,
snippet of code and then paste that snippet in your post. Readers
usually don't want to have to read through your entire program to
understand what you are asking them.

Having said that, pickle is for serializing data. You shouldn't be
opening a file in read/write/append mode and dumping and loading to the
same file object. It's not a multi-access database like a DBMS is. The
basic idea is:

1. open (empty) file write-only.
2. dump object(s) to file.
3. close file

or

1. open file read-only
2. load object(s) from file
3. close file

Anything other than the two may lead to undesired/undefined behavior.

But the likely answer to your question is that your pickle file has (at
least) 2 objects stored in it. And so on each load you get subsequent
objects. That's probably the "undesired" affect of opening the file in
append mode.

3. pb structure when compil

4. structured ,semi-structured,non-structured data

5. PB Swiss PB 8515 Allrounder 31 Piece Tools in Roll-Up Set

6. PB Swiss PB-6190/2-100 Size 2 Multicraft Screwdriver

7. m-file : No Pb , dll : Pb , Why?

8. PB Swiss PB 8243C 4-Piece Pozidrive Set with Swiss Grip

9. PB Swiss PB 212L HC-10Ye 9 Piece Yellow Hex Key Set

10. Annoying PB issue with Error List and Build Window in PB 6

11. PB Swiss PB 8240C 6-Piece Slotted Driver Set with Swiss Grip

12. PB Swiss PB-6100/6 Size 6 Multicraft Screwdriver

13. OK to Clone PB G4 Ti to PB G4 Al

14. Will PB 5.0 and the PB 6.0 Visual Studio plugin coexist?

15. Convert PB 3.0 build to PB 4.2 build?