|
Post by tenochtitlanuk on Feb 23, 2019 15:10:52 GMT -5
Also testmultiarrays.bas crashes when it tries to look up a term in a 3D array with only one dimension specified... dim a(3, 3, 3) a(1, 2, 3) = 5 a(3, 2, 1) = 4 print a(1, 2, 3) + a(3, 2, 1) print a(1) <<<<<<<
|
|
|
Post by tenochtitlanuk on Feb 23, 2019 15:08:46 GMT -5
Linux drawx.bas looks for bmpbutton #1.red, "bmp\redbttn.bmp" but bmp folder holds REDBTTN.BMP - so yes you need to rename some. Can't remember which example looked for a jpg- probably the same 'case sensitive' problem.
|
|
|
Post by tenochtitlanuk on Feb 23, 2019 14:54:39 GMT -5
You might like to check the contents of this- two example programs crashed because of a missing bmp ( redbttn in one, and in the other case looked for a non-existent jpg...)
|
|
|
Post by tenochtitlanuk on Feb 23, 2019 7:12:18 GMT -5
I gave the Windows version a quick spin under Wine, but couldn't get the native Linux to run at first. Did sudo ./lin32-347 lb5alpha.im from the downloaded directory. Failed. Then realised you have to first mark the files as executable.. runs OK now. Now for some fun-- well done Carl to get this far.
|
|
|
Post by tenochtitlanuk on Feb 12, 2019 15:16:12 GMT -5
|
|
|
Post by tenochtitlanuk on Feb 10, 2019 15:46:37 GMT -5
|
|
|
Post by tenochtitlanuk on Feb 9, 2019 6:31:23 GMT -5
Not sure if that is not the opposite of eye-catching!! Hope I 'fade away' with equally dramatic effects as I head for yet another birthday in my 70s!
I love LB's ability to do this kind of graphics so easily..
|
|
|
Post by tenochtitlanuk on Feb 8, 2019 17:16:26 GMT -5
This is a ( poorly thought out) suggested task on Rosetta Code. Gave me a couple of happy hours of coding to get this..
Will put my method up on my site in a few days- meanwhile anyone up for trying it out? Once you've got it working there are all sorts of variations to try- say triangles, or rotating each of the nested shapes, or different colour sequences...
|
|
|
Post by tenochtitlanuk on Feb 2, 2019 15:48:41 GMT -5
Written for fun some time ago- calling the sub in various ways...
|
|
|
Post by tenochtitlanuk on Feb 2, 2019 12:46:36 GMT -5
This may give you some ideas- but note it is much harder if you actually want the LETTERS turned sideways!
nomainwin
WindowWidth = 400 WindowHeight = 400
open "Graphics" for graphics_nsb as #wg
#wg "trapclose [quit]"
#wg "fill lightgray ; backcolor lightgray"
for i =1 to 10 call verticalText "Example",_ ' Desired text int( 20 +360 *rnd( 1)), int( 20 +160 *rnd( 1)),_ ' Position "Courier_New bold",_ ' Font 8 +int( 20 *rnd( 1)),_ ' Font size randCol$() ' Font colour next i
#wg "flush"
wait
[quit] close #wg end
function randCol$() R =int( 256 *rnd( 1)) R$ =str$( R) G$ ="120" B$ =str$( 256 -R) randCol$ =R$ +" " +G$ +" " +B$ end function
sub verticalText text$, xPos, yPos, fontName$, fontSize, colour$ #wg "color "; colour$ #wg "font "; fontName$; " "; fontSize
for j =1 to len( text$) #wg "up ; goto "; xPos; " "; yPos +fontSize *1.5 *( j -1); " ; down" #wg "\"; mid$( text$, j, 1); next j end sub
|
|
|
Post by tenochtitlanuk on Jan 27, 2019 19:28:48 GMT -5
This image,1024x512, was generated in about 3 minutes. I'm prepared to wait that kind of time- grab a coffee or similar. I reckon even reading your data rather than generating the pixels would take similar speed. If you really need 2048x2048 images it would take 8 times as long, of course. Perhaps relevant is that once image size exceeds your screen display, or an internal JB/LB limit, I find that my ( Linux) setup crashes. And getbmp may fail.. I generate these large images by writing the data straight to a 24 bit BMP file. I can supply code on my website if you are interested.
|
|
|
Post by tenochtitlanuk on Jan 18, 2019 12:59:11 GMT -5
I'll be very glad if you get this working- I've wanted to code this for years. My brother's son is Material Science prof running a lab at Stanford & stunned me when he showed photos of pentagonal crystals he'd grown back when they were first discovered- my crystallography background had taught me they were impossible.
You've left off the rgb() function definition. When I add it it fails on the triangle sub being called with fewer than the seven parameters it is defined as needing..
|
|
|
Post by tenochtitlanuk on Jan 6, 2019 14:35:24 GMT -5
I had understood 'concatenate the columns' to mean end-to-end. In fact what was meant was I gather 'concatenate the terms in the two columns, row by row, to make a new column'. Many ways to achieve end result, as always.
Personally I use spreadsheets and databases to do this kind of data handling, although grateful on occasion for LB's 'sort'.
|
|
|
Post by tenochtitlanuk on Jan 6, 2019 12:17:08 GMT -5
Don't see how that would work, alincon. Diagram below shows one and two columns being sorted..
|
|
|
Post by tenochtitlanuk on Jan 4, 2019 18:18:13 GMT -5
This illustration code works for me- the datafile is at www.diga.me.uk/UNdata_Export_20190104_222603438.csv if you want to try it. NB I work on Linux, so you may need to change LF<>CRLF. Note that the second time round I sort only data between the beginning and end rows that I found. Since it is a text field, the sort puts say 1 and 100 before 2. Beware! If you want, after the first sort, to sort EACH block with a common value, you'd need to repeat the third stage appropriately. I don't know what your data represents, so can't check if you want this- need to see your data tanble really... dim data$( 10000, 10)
open "UNdata_Export_20190104_222603438.csv" for input as #fIn '241 rows in 6 columns print "Unsorted original data, showing only columns 2, 3 and 4" for i =1 to 241 line input #fIn, line$ ' "Country or Area","Sex","Age","Type of living quarters","Value","Value Footnotes" for j =1 to 6 data$( i, j) =word$( line$, j, ",") next j 'print data$( i, 1); ","; data$( i, 2); ","; data$( i, 3); ","; data$( i, 4); ","; data$( i, 5); ","; data$( i, 6) print data$( i, 2); ","; data$( i, 3); ","; data$( i, 4) next i
close #fIn
sort data$(), 2, 241, 4 ' sort by column 4 #type of living quarters'
print "" print "Sorted by column 4"
for i =1 to 241 'print data$( i, 1); ","; data$( i, 2); ","; data$( i, 3); ","; data$( i, 4); ","; data$( i, 5); ","; data$( i, 6) print data$( i, 2); ","; data$( i, 3); ","; data$( i, 4) next i print "" print "Finding first and last rows with 'roofless' in column 4" ' Find first appearance of 'Roofless' and last in column 4 firstRow =0 lastRow =0
for i =1 to 241 if data$( i, 4) =chr$( 34) +"Roofless" +chr$( 34) and firstRow =0 then firstRow =i if firstRow <>0 and data$( i, 4) <>chr$( 34) +"Roofless" +chr$( 34) then lastRow =i -1: exit for ' since we detected we'd just past it.. next i
print "First was row "; firstRow; " and last was "; lastRow
print "" print "Now sorting by column 3 ( 'age') BUT only the rows in-range' leaving rest as-is" ' now sorted by column 3 'age' and column 4 'type of accomodation' sort data$(), firstRow, lastRow, 3
for i =1 to 241 'print data$( i, 1); ","; data$( i, 2); ","; data$( i, 3); ","; data$( i, 4); ","; data$( i, 5); ","; data$( i, 6) print data$( i, 2); ","; data$( i, 3); ","; data$( i, 4) next i
end
|
|