PDA

View Full Version : need commands for rectangle, circle, line, background/foreground color, etc.



GryByteman
04-12-2014, 10:25 PM
What I am trying to do is create in WORD what I have already done in RFO BASIC on my Kindle Fire,

Imagine a big square sort of divided into ninths I draw the big square with bolder lines, then with narrower lines, draw the diagonals, draw "corner" squares, and draw a circle in the center that touches each of the four inner squares.

I know how to do all the "normal" stuff, but I need help converting any line that starts with "Gr", and I also need to know the equivalent of PAUSE.

<RFO>
gr.open 255,255,255,255 REM open graphic image workspace with white background
pause 1000 REM pause one second
Gr.color 255,0,0,0,0 REM set drawing color to black
gr.set.stroke 3 REM set line width to 3
gr.rect a,30,30,300,300 REM draw a square from (30,30) to (300,300)
gr.line a,30,30,300,300 REM draw a diagonal line from (30,30) to (300,300)
gr.line a,30,300,300,30 REM draw the other diagonal line
gr.set.stroke 2 REM set line width to 2
for a=30 to 210 step 180 REM a=30, then a=210
for b=30 to 210 step 180 REM b=30 then b=210
gr.rect c,a,b,a+90,b+90 REM draw four small squares inside the corners of the big square
next
next
gr.circle a,165,165,45*sqr(2) REM draw a circle in the center of the diagram that touches the small squares
gr.text.align 2 REM center text to be printed at the coordinates specified
gr.text.typeface 2 REM specifies a particular typeface (doesn't matter which one)
gr.text.bold 1 REM bold font
gr.text.size 22 REM font size in pixels
gr.text.draw a,165,24,"10" REM draw numbers 10, 11, 12, and 13 at specified positions.
gr.text.draw a,165,324,"11" REM in RFO, (165,24) points to bottom row of text, center of text.
gr.get.textbounds "12",l,t,r,b REM retrieve left, top, right and bottom coordinates of how "12" would look
gr.text.draw a,13,165+b,"12"
gr.text.draw a,317,165+b,"13"
gr.render REM display all figures on graphic screen
gr.front 1 REM be sure graphic screen is in front of regular text screen
do REM pause until break
until 0
</RFO>

Thanks for any help you can provide. This old (62 now) mind is enjoying the challenges of programming once again.

John

macropod
04-13-2014, 01:59 AM
VBA in Word doesn't work that way. If you want to create a grid in Word, you might insert a table. For the circle, you'd insert an 'oval' autoshape. You can't simply draw lines on a page. See attached document. VBA could be used to create the content, though I've done it entirely through the GUI, though.

GryByteman
04-13-2014, 06:40 AM
It used to work that way. Eight years ago, I created a Biblical Bracelet puzzle using Word for Windows on an office computer. All I did was draw lines and plot text into specific locations in the diagram, but it did work.'

So, I'd sure love to find out they haven't removed that capability, or perhaps I need to find one of the older WORD versions that has the capability.

By the way, I tried to open your attachment, but my computer refused to let me access "attachment.php". Any advice on how to look at your attachment.

John

GryByteman
04-13-2014, 06:40 AM
In any case, thank you, your time is appreciated. SOrry I forgot to lead with that 60 seconds ago.

macropod
04-13-2014, 12:26 PM
It used to work that way..
Not that I know of - and I've been using Word for over 20 years. I suspect you were using Word's line autoshapes. Those you can place anywhere on a page and simply set a height and width to get the desired line. There isn't one for defining a circle by, say centre-point and radius, though.

By the way, I tried to open your attachment, but my computer refused to let me access "attachment.php". Any advice on how to look at your attachment.
If you can't open the attachment directly, try right-clicking on it and using 'Save attachment as' to copy it to your PC.