Code:
/* phpBB f?cked up the #includes, so I'm leaving * them out. phpBB sucks. */#define COLOR "RED"main() { const char *NREDFG = "\001N\001R"; char BARCOLOR[30]; const char *INTENSITY1 = "NORMAL"; /* Let's attempt to access NREDFG based on its * name. */ /* Build a string into BARCOLOR */ BARCOLOR[0] = INTENSITY1[0]; BARCOLOR[1] = 0; strcat(BARCOLOR, COLOR); strcat(BARCOLOR, "FG"); /* Whoops! */ printf("%s\n", BARCOLOR);}
Code:
' Assuming that you're going to support three intensities ("DIM",' "NORMAL", and "BRIGHT") and 16 colors. The numbers' in the DIM statement are maximum array subscripts, rather' than sizes.DIM colorTable(2, 15) AS STRING' Populate the table.colorTable(0,0) = CHR$(1)+"D"+CHR$(1)+"B"colorTable(1,0) = CHR$(1)+"N"+CHR$(1)+"B"' Etc...
Code:
DIM colorCode AS STRINGcolorCode = colorTable(getIntensity%(INTENSITY$), getColor%(BARCOLOR$))
Statistics: Posted by historian — Sat Jun 16, 2007 1:34 pm
Code:
BARCOLOR$ = NREDFG$
And yes, I'm aware this isnt waht you asked.Statistics: Posted by Z!re — Thu Mar 01, 2007 11:57 am
Statistics: Posted by Mike Alexander — Sat Dec 09, 2006 10:00 pm