Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create field
Message
From
27/11/2001 07:20:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00586205
Message ID:
00586221
Views:
23
Moises,

Something like this should work:
SELECT < TableToCheck >
IF TYPE("< FieldToCheck >") = "U"
  *-- field doesn't exist
  ALTER TABLE < TableToCheck > ADD COLUMN < YourField > C(50)
ELSE
  *-- field exists, check the size
  IF FSIZE("< FieldToCheck >") <> 50
    *-- change size of field
    ALTER TABLE < TableToCheck > ALTER COLUMN < YourField > C(50)
  ELSE
    *-- all is fine
  ENDIF
ENDIF
HTH
>Please I need a little routine
>
> When start my program:
>
> Check if a field exists
> If it does not exist, creates that field
>
> If the field exists check it's size
> If it has less the 50character, for e.g., change it to 50.
>
> TIA
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform