Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modify structure in code?
Message
From
04/12/1998 20:55:22
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00163936
Message ID:
00164373
Views:
28
I agree Paul's view, it is not good on modify structre at run-time!

1. You need to Exclusive right on table, it is NOT flexible for
multi-user
2. In case your application crash during reformat the table, you lose ur table!


You're better to add some Order tag on the table and you can use grid to set the
appear table order by move the column left or right!

For your cases, you can simply use the Column Name as variable,
Do case
Case PubLanguage = "English"
   seek ID = "87"
   Thisform.label1.caption = MultCap.English
   seek ID = "88"
   Thisform.label2.caption = MultCap.English
   ...
Case PubLanguage = "Danish"
   seek ID = "87"
   Thisform.label1.caption = MultCap.Danish
   seek ID = "88"
   Thisform.label2.caption = MultCap.Danish
   ...
endcase
Then, even you don't set the order on English, Danish....
You still got the right caption show!! ^-^;




>Hi Paul,
>
>I have written a multi-language bird-recording application and I have two tables that I want to reorder. The first table contains birdnames and the second contains words/different phrases and so on, to populate buttons, labels, messageboxes etc. The preferred language for the application gets all the phrases from the second table.
>
>In my code, I use FIELD() on the birdnametable to create a popup containing all the available options - swedish, english, danish (and some more). Dependning on the preferred language for the whole application, I want to show the preferred language as first item in the popup.
>
>I use the order of the fields in the birdnametable to add/change labels and textboxes (caption and controlsource). If I could reorder the fields, I would be able to have the preferred language as the first language.
>
>If I want to add a language to my application I only add a column to the selected table. Nothing else. I don't have to change any code.
>
>Thats why I want to be able to reorder the fields.
>
>/Pierre
>
>
>>Keep an empty table with your temp structure. At runtime, copy this struct to a temp table and append from the old table.
>>
>>Or, better, :) use a SELECT SQL:
>>
>>select id, english, danish, swedish from oldtable into cursor temptable
>>
>>But why do you need something like this? I've never needed to change the order of the fields in a table.
>>
>>Vlad
>>
>>>I am looking for a way to reorder the fields in a table. I have a table like this:
>>>
>>>id N(4,0)
>>>swedish C(30)
>>>english C(30)
>>>danish C(30)
>>>
>>>and I want it temporarily to look like this:
>>>
>>>id N(4,0)
>>>english C(30)
>>>danish C(30)
>>>swedish C(30)
>>>
>>>This can easily be done in the Table Designer but I want to do it by code!
>>>
>>>/Pierre Unge, Sweden
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform