>CLOSE ALL >CLOSE DATABASES >OPEN DATABASE D:\GIN2006\TABLES\ACCOUNT >tbname=justfname(thisform.pageframe1.page2.list1.value) >USE &tbname >gnFieldcount = AFIELDS(gaMyArray) > >FOR nCount = 1 TO gnFieldcount > ? gaMyArray(nCount,1) >ENDFOR >>The above codes work fine.
LOCAL lcFile as String, lcRowSource as String, lcAlias as String STORE [] TO lcFile, lcRowSource, lcAlias lcFile = ThisForm.Text1.Value SELECT 0 USE (lcFile) AGAIN lcAlias = ALIAS() lnFieldCount = AFIELDS(laMyArray,lcAlias) FOR nCount = 1 TO lnFieldCount lcFieldName = laMyArray[nCount,1] lcFieldType = laMyArray[nCount,2] lcFieldLength = TRANSFORM(laMyArray[nCount,3]) lcFieldDecimal = TRANSFORM(laMyArray[nCount,4]) lcColumn1 = lcFieldName lcColumn2 = lcFieldType + [(] + lcFieldLength + IIF(lcFieldDecimal#[0],lcFieldDecimal,[]) + [)] IF !EMPTY(lcRowSource) lcRowSource = lcRowSource + [,] ENDIF lcRowSource = lcRowSource + lcColumn1 + [,] + lcColumn2 ENDFOR *!* Need to adjust to point to the correct object ThisForm.List1.Width = 250 ThisForm.List1.ColumnCount = 2 ThisForm.List1.ColumnWidths = [125,125] ThisForm.List1.RowSourceType = 1 && VALUE ThisForm.List1.RowSource = lcRowSource USE IN (lcAlias)