|
Post by metro on Jun 20, 2020 21:41:33 GMT -5
I'm obviously missing something, how does one name 200 rows in a grid? seems you can use strings ' #w.grid rownames("lock","stock", "barrel") but not a variable
dim a$(3, 200) grid #w.grid, a$(), [clicked], 10, 10, 300, 300 for x = 0 to 3 for y = 0 to 200 a$(x,y) = "c"+str$(x)+" r"+str$(y) next y next x open "Grid test" for window as #w #w.grid columnnames("lock", "stock", "barrell", "powder") #w.grid columnwidths(50) #w.grid rownames(1, 2,3,4)' HOW DO I NAME 200 rows #w.grid rowlabelwidth(50) #w.grid selectxy(2, 2) print #w.grid value$() #w.grid setvalue("yahoo") print #w.grid value$() print #w.grid debug$() wait
[clicked] print "clicked: "; #w.grid cellxy$() wait
|
|
|
Post by meerkat on Jun 21, 2020 1:28:44 GMT -5
Howdy down yunder..
Ya! Sometimes you don't know what the headings will be or the widths until you run the program. Maybe something like this will work.
dim colName$(200) for i = 1 to 200 colName$(i) = "Col:";i next i q$ = chr$(34) cma$ = "" cn$ = "" ' column names for grid cw$ = "" ' column widths for i = 1 to 200 ' set names and col names from array cn$ = cn$ + cma$ + q$ + colName$(i) + q$ cw$ = cw$ + cma$ + q$ + len(colName$(i)) + q$ cma$ = "," next i print "column names:";cn$ print "column width:";cw$ a = eval("#w.grid columnnames("+cn$+")") ' put column names on the grid a = eval("#w.grid columnwidths("+cw$+")") ' set the column widths on the grid
Hope this helps. Y'all have a great day now..
|
|
|
Post by metro on Jun 21, 2020 2:23:55 GMT -5
G'Day Dan, as luck would have it , Ya all answered my question by not answering my question one little change first using str$ (not needed for what I wanted though) cw$ = cw$ + cma$ + q$ + str$(len(colName$(i))) + q$ then used this to give me what I wanted.... rownames Thanks for the help I'd buy ya a beer but it's too cold here hmm it's 5 o'clock somewhere time for a red
|
|