Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert fields type
Message
From
06/03/2007 04:52:49
 
 
To
06/03/2007 04:48:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01130716
Message ID:
01200959
Views:
16
My code will work with SET EXACT OFF. Another solution, which is independent of EXACT:
If left(Upper(gaMyArray(nCount,1)),1)='Q' and gaMyArray(nCount,2)='C'
>HI,
>if my field start with q,qa,q1,q21,qe4 or qa27..., how i can let this vfp code work.
>
>
>If Upper(gaMyArray(nCount,1))='Q' and gaMyArray(nCount,2)='C'
>
>thanks
>
>>>thank you very much,
>>>Something like this should work?of course it must:).
>>
>>Well, I did test it...! :-)
>>
>>>>Something like this should work
>>>>Use dnc Exclusive
>>>>gnFieldcount = AFIELDS(gaMyArray)
>>>>For nCount = 1 To gnFieldcount
>>>>  If Upper(gaMyArray(nCount,1))='Q' and gaMyArray(nCount,2)='C'
>>>>    Wait "Converting "+gaMyArray(nCount,1) WINDOW nowait
>>>>    Alter table dnc alter column (gaMyArray(nCount,1)) n(10,2)
>>>>  EndIf
>>>>EndFor
>>>>Wait clear
>>>>
>>>>>hi,
>>>>>i need something as vfp example..
>>>>>
>>>>>USE dnc
>>>>>
>>>>>gnFieldcount = AFIELDS(gaMyArray)
>>>>>CLEAR
>>>>>FOR nCount = 1 TO gnFieldcount
>>>>>   ? gaMyArray(nCount,1)
>>>>>   alter(all field begin with Q to numaric type)&&& what kind of code i must write to do it?
>>>>>ENDFOR
>>>>>
>>>>>thanks all the time
>>>>>>Sorry, but I donæt have the time to give you the code. But the easiest is to read the data from the excel file into a temp cursor, and then append the data from the temp cursor into a table which you have already created with the correct structure. In semicode, which is NOT ment to work, only show you briefly:
>>>>>>*Read the Excel file into the cursor curtemp && Change the code you already use
>>>>>>Create table yourtable ... && With the structure you want
>>>>>>Append from dbf('curtemp')
>>>>>>Another approach is to use Afield() on the table, and then use Alter Table on each field which has a name beginning with q and whick is of type character.
>>>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform