Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Characters type
Message
 
To
17/12/2006 07:59:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01178382
Message ID:
01178384
Views:
17
How about something like this;
WITH ThisForm
  .text1.Value = GETFILE('dbf')
  .select_file = .Text1.Value
*  IF NOT EMPTY(.select_file) && This line does not guarantee that the file exists
  IF FILE(.select_file) && This checks for the file to exist
      USE (.select_file)
      AFIELDS( .my_fields, JUSTSTEM(.select_file) )
      WITH .Combo1
        .RowSourceType = 5
        .RowSource = [ThisForm.my_fields]
        .Value     = ThisForm.my_fields[1]
        .Requery() && Needed to reload the combo's list with the values in the array
        .Interactivechange() && Don't know why this line is in your code
      ENDWITH
* Th next line is redundant as this value is already set in this control
*      .text1.value = (ThisForm.select_file)
       .text1.Visible  = .t.
  ENDIF
ENDWITH
>hi all,
>i need help to get fields(characters type only) at combo1
>via this code under
>
>thisform.text1.Value=GETFILE('dbf')
>m.t=(thisform.text1.value)
>ThisForm.select_file=(M.T)
>IF NOT EMPTY(ThisForm.select_file)
>   USE (m.t)
>    AFIELDS(ThisForm.my_fields,JUSTSTEM(ThisForm.select_file))
>      ThisForm.combo1.RowSourceType = 5
>   ThisForm.combo1.RowSource = [ThisForm.my_fields]
>   ThisForm.combo1.Value     = ThisForm.my_fields[1]
>   ThisForm.Combo1.Interactivechange()
>     ThisForm.text1.value = (ThisForm.select_file)
>    ThisForm.text1.Visible  = .t.
>ENDIF
>
> thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform