Demonstration Programs Distributed
Gateway for Windows is delivered with a number of demonstration programs included on the distribution media. Inspection of these programs is the best way to become familiar with VIP Gateway for Windows programming techniques, and developers are encouraged to run and review these demonstration programs.
Two of these programs are included here. They are written in Thoroughbred Basic. You can adapt them to your own programming language as necessary.
GWWDEM1
Section titled “GWWDEM1”This is an example of a host program communicating with Microsoft Excel. This program:
- Initiates communication with Excel, starting it if it is not already active.
- Transmits a series of data to the spreadsheet.
- Retrieves the contents of a calculated field in the spreadsheet.
- Creates a 3-Dimensional color graph from the spreadsheet.
- Locates and re-sizes the display.
GWWXCEL
Section titled “GWWXCEL”This is an example of a standard public program to use for generic Excel communications.
GWWXCEL can be used to automatically interface to Microsoft Excel with a simple CALL statement.
The examples using Excel in this manual are designed to work with Excel 97 or earlier. Some changes may be required for later versions.
00010 REM"GWWDEM1 Build Excel Graph using GWW"00020 BEGIN; ! begin SETERR 9990; ! seterr for end SETESC 9990; ! setesc for end PRINT 'CS'; ! clear screen VIPSC$="|"; ! set separation character GWW$=CGV("GWW",ERR=25); ! get gww common global IF GWW$(1,1)<>"Y" ! if gww not set on GOTO 25 ! run gww initiate ELSE ! else IF GWW$(4,1)<>"N" ! if sep char <> "N" VIPSC$=GWW$(4,1) ! set sep char to workstation std FI; ! endif GOTO 30 ! go process FI ! endif
00025 RUN "GWW" ! run gww initiate program00030 IF SSN <> 108012345 AND SSN <> 104012345 GOTO 40
00035 INPUT 'CS', @(0,1),"Use Excel, Lotus123 or QuattroPro? (E/L/Q): ", O$; IF O$ = "L" OR O$ = "l" RUN "GWWDEMA",ERR=30 ELSE IF O$ = "Q" OR O$ = "q" RUN "GWWDEMQ",ERR=30 FI FI
00040 PRINT 'CS', @(0,1),"GWWDEM1 - Gateway to Windows To Excel Communication Example 1", @(0,3),"This example program will do the following:", @(0,5)," 1. Initiate communication with Excel, starting it", @(0,6)," if it is not already active on the workstation", @(0,7)," 2. Transmit a series of data to a spreadsheet", @(0,8)," 3. Retrieve the contents of a field in the spreadsheet", @(0,9)," 4. Transmit a series of formatting commands to ", @(0,10)," create a 3 dimensional multi-color graph from", @(0,11)," the spreadsheet", @(0,12)," 5. Locate and size the graph to a specific location", @(0,13)," on the screen", @(0,14)," 6. Show you the data and instructions being transmitted", @(0,15)," to produce this display"
00042 PRINT @(0,16)," "
00043 INPUT "Run Gateway to Windows Excel Communication Example (Y/N)?: ",Y$
00050 IF CVT(Y$,32) = "N" OR CTL=4 GOTO 999000060 IF CVT(Y$,32) <> "Y" GOTO 10
00070 INPUT "Enter the title to use for your Excel Chart: ", Y$00080 IF CTL=4 GOTO 1000090 IF Y$ = "" Y$ = "VIP Gateway To Windows"
00100 PRINT 'CS',
00110 WINDOW CREATE (75,4,0,1) "BORDER=LG", "TITLE=Gateway to Windows", "BORDERATR=FG", "NAME=GWW"01000 PRINT @(2,2),"Starting Excel",
! Only statements with an asterisk indications -------------------**! are required for Gateway To Windows communication **
01005 DIM MSG$[6]; ! set communication variables ** EXNAME$="EXCEL.EXE" ! set excel source program name01010 MSG$[1]="I6"; ! Function: Initiate(NoFocus,Minim)** MSG$[2]=EXNAME$; ! Appl: Excel ** MSG$[3]="SYSTEM"; ! Topic: System ** MSG$[4]=""; ! Item: None ** MSG$[5]=""; ! Data: None ** GOSUB 2000 ! Call GWWCOM **
01030 IF MSG$[0] = "." ! if good call PRINT @(0,2),'CL', ! print @(2,2),"Excel Started", ! confirmation ELSE ! else PRINT @(0,2),'CL', ! print @(2,2),MSG$[0], ! error FI; ! endif
IF MSG$[0] <> "." ! if not good call INPUT "- CR TO CONTINUE",*,; ! require acknowledge WINDOW DELETE ("GWW"); ! delete the window GOTO 10 ! and restart FI ! endif
01100 PRINT @(0,2),'CL', ! print @(2,2),"Building Graph.", ! building graph message
! create window to show data being transmitted
01105 WINDOW CREATE(22,08,0,5) "BORDER=LG", "TITLE=Data Transmitted", "BORDERATR=FG", "NAME=GWR";
WINDOW CREATE(22,3,0,13) "BORDER=LG", "TITLE=Data Retrieved", "BORDERATR=FG", "NAME=GWX";
WINDOW CREATE(75,07,0,16) "BORDER=LG", "TITLE=Formatting Data Transmitted", "BORDERATR=FG", "NAME=GWF"; WINDOW SELECT ("GWR")
01109 MSG$[1]="E"; ! Function: Execute ** MSG$[2]=EXNAME$; ! Appl: Excel ** MSG$[3]="SYSTEM"; ! Topic: System ** MSG$[4]=""; ! Item: None ** MSG$[5]="[ERROR(FALSE)]" ! Data: Start with error off ** +"[A1.R1C1(FALSE)]"; ! and R1C1 style GOSUB 200001110 MSG$[1]="P"; ! Function: Poke Data ** MSG$[2]=EXNAME$; ! Appl: Excel ** MSG$[3]="SHEET1"; ! Topic: Sheet1 ** MSG$[4] = "|R1C2|" ! Items: Set Items For Trans ** + "|R2C2|" ! + "|R3C2|" ! + "|R4C2|" ! + "|R5C2|" ! + "|R1C3|" ! + "|R2C3|" ! + "|R3C3|" ! + "|R4C3|" ! + "|R5C3|" ! + "|R6C3|"; ! Q$=CHR(34); ! set quote character
MSG$[5] = "|="+Q$+"A"+Q$+"|" ! Data: Set Data Content ** + "|="+Q$+"B"+Q$+"|" ! + "|="+Q$+"C"+Q$+"|" ! + "|="+Q$+"D"+Q$+"|" ! + "|="+Q$+"E"+Q$+"|" ! + "|1|" ! + "|2|" ! + "|3|" ! + "|4|" ! + "|5|" ! + "|=SUM(R1C3:R5C3)|"; ! Formula for Excel
FOR X = 1 TO 5; ! print all data on char screen PRINT @(0,X-1),"R"+STR(X)+"C2",; PRINT @(4,X-1),"="+Q$+CHR(64+X)+Q$,; ! PRINT @(10,X-1),"R"+STR(X)+"C3",; PRINT @(15,X-1),STR(X),; ! NEXT X; PRINT @(0,5),"R6C3",; PRINT @(4,5),"=SUM(R1C3:R5C3)",;
GOSUB 2000; ! Call GWWCOM For all items **
WINDOW SELECT ("GWX"); ! select retrieve window PRINT @(0,0),"R6C3=",; ! print column to retrieve
MSG$[1]="R"; ! Function: Retrieve ** MSG$[4]="|R6C3|"; ! Item: Column ID ** GOSUB 2000; ! call DDECOM **
R$ = MSG$[5]; ! set response IF MSG$[0]="." ! if good response R$=R$(2,LEN(R$)-2 ! trim off "|" around ! response ELSE ! else R$ = MSG$[0] ! set response to error code FI; ! endif PRINT @(5,0),R$,; ! print response
WINDOW SELECT ("GWF"); ! select FORMAT window Q$ = CHR(34); ! set char for quote (")
MSG$[1]="E"; ! Function: Execute ** MSG$[2]=EXNAME$; ! Appl: Excel ** MSG$[3]="SYSTEM"; ! Topic: System ** MSG$[4]=""; ! Item: None **
! Following statements conform to Excel requirements for DDE ! as documented in Excel Functions. ! They perform the following: ! Activate the spreadsheet "sheet1" ! Select cells build during dde conversation above ! set proper alignment ! set borders ! define a new graph ! Add a legend ! Add some text ! Set the graph format
X$ = ""; X$ = X$ + "[ACTIVATE(" + Q$ + "SHEET1" + Q$ + ")]"; X$ = X$ + "[FULL(TRUE)]"; X$ = X$ + "[SELECT(" + Q$ + "R1C2:R5C3" + Q$ + ")]"; X$ = X$ + "[ALIGNMENT(4)]"; X$ = X$ + "[BORDER(FALSE,FALSE,FALSE,TRUE,FALSE,FALSE)]"; X$ = X$ + "[NEW(2,1)]"; X$ = X$ + "[FORMAT.MAIN(3,1,0,50,TRUE,FALSE,FALSE)]"; X$ = X$ + "[ATTACH.TEXT(1)]"; X$ = X$ + "[FORMULA("+Q$+"="+Q$+Q$+Y$ + Q$ + Q$ + Q$ + ")]"; X$ = X$ + "[FORMAT.FONT(0,1,FALSE," + Q$ + "HELV" + Q$ +",18,FALSE," + "FALSE,FALSE,FALSE)]"; X$ = X$ + "[SELECT(" + Q$ + Q$ + ")]";
! the following statements ! (1) make the spreadsheet normal sized ! (2) set the size of the spreadsheet in points ! (3) set the location of the spreadsheet
X$ = X$ + "[APP.RESTORE()][APP.SIZE(330,200)][APP.MOVE(140,10)]";
PRINT @(0,0),X$,;
MSG$[5]=X$; ! ** GOSUB 2000; ! call DDECOM **
WINDOW SELECT ("GWW"); IF MSG$[0] = "." ! if good call PRINT @(0,2),'CL', ! print @(2,2),"COMPLETE!", ! confirmation ELSE ! else PRINT @(0,2),'CL', ! print @(2,2),MSG$[0], ! error message FI; ! endif
INPUT " - CR TO CONTINUE (Excel will terminate)", *;
WINDOW SELECT ("GWF");
PRINT 'CS',;
MSG$[1]="E"; ! Function: Execute ** MSG$[3]="SYSTEM"; ! Topic: System ** MSG$[5]="[CLOSE(FALSE)] ! Data: Close graph ** +"[CLOSE(FALSE)]"; ! and spreadsheet **
PRINT @(0,0),MSG$[5],;
GOSUB 2000; ! call DDECOM **
MSG$[1]="E" ! Function: Execute ** MSG$[3]="SYSTEM"; ! Topic: System ** MSG$[5]="[QUIT()]"; ! Data: Quit Excel **
PRINT @(0,1),MSG$[5],;
GOSUB 2000; ! call DDECOM **
MSG$[1]="F"; ! set focus MSG$[2]="ME"; ! back to this task MSG$[5]=""; ! with no keystrokes GOSUB 2000; ! call DDECOM for focus
WINDOW SELECT ("GWW");
PRINT @(0,2),'CL',@(2,2),"EXCEL TERMINATED!",;
INPUT " - CR TO CONTINUE", *;
WINDOW DELETE ("GWW"); ! delete active window WINDOW DELETE ("GWR"); WINDOW DELETE ("GWX"); WINDOW DELETE ("GWF"); GOTO 10 ! go rerun01800 IF VIPSC$ <> "|" ! INT'L if not a standard sep ! char OLD$=MSG$[4]; ! using msg$[4] CHAR$="|"; ! set look for char to standard RCHAR$=VIPSC$; ! set replace char to override GOSUB 1900; ! set new char MSG$[4]=OLD$; ! and replace OLD$=MSG$[5]; ! using msg$[5] GOSUB 1900; ! set new char MSG$[5]=OLD$ ! and replace FI; ! endif RETURN ! return
01850 IF VIPSC$ <> "|" ! *INT'L if not a standard sep char OLD$=MSG$[5]; ! using result CHAR$=VIPSC$; ! set look for char to override RCHAR$="|"; ! set replace char to standard GOSUB 1900; ! go replace MSG$[5]=OLD$ ! and restore result FI; ! endif RETURN ! return
01900 WHILE POS(CHAR$=OLD$)<>0; ! INTL while look for char is in ! string SCPOS=POS(CHAR$=OLD$); ! set its position OLD$(SCPOS,1)=RCHAR$; ! replace with override char WEND; ! wend RETURN ! return
02000 REM"TRANSMIT TO GATEWAY" ! call DDECOM **
02010 GOSUB 1800 ! INT'L ONLY - check for sep char
02060 CALL "GWWCOM",MSG$[ALL] ! call public **
02070 GOSUB 1850 ! INT'L ONLY - check for sep char
02090 RETURN ! RETURN **
09990 RUN "VIPMENU",ERR=999109999 ENDThe following is an example of the results that can be obtained with proper implementation of Gateway for Windows using the program GWWXCEL.
Thoroughbred Basic Code Required
Section titled “Thoroughbred Basic Code Required” TITLES="|2005 Sales||2006 Sales||2007 Sales|"; DATA1$="|825000.00||1245000.00||1475000.00|"; DATA2$=""; NAME$="My Company Sales"; CALL"GWWXCEL","MYPROG",TITLE$,DATA1$,DATA2$,NAMES$,70,24,1,1;00010 REM "GWWXCEL Build Excel Graph Using GWW Public Routine"00015 SETERR 09990; ! seterr SETESC 09990 ! setesc
00020 ENTER P$ ! programname Y1$, ! referencename string Y2$, ! data string Y3$, ! 2nd data string (optional) T$, ! report title W, ! width in characters H, ! height in lines C, ! starting column R ! starting line
00025 SETERR 09990; ! seterr SETESC 09990; ! setesc Q$=CHR(34); ! set quote character VIPSC$="|"; ! set separation character ! default GWW$=CGV("GWW",ERR=9990); ! get gww global IF GWW$(1,1)<>"Y" ! ifot on GOTO 9990 ! exit ELSE ! else IF GWW$(4,1)<>"N" ! if sep charot = VIPSC$=GWW$(4,1) ! set override sep char FI ! endif FI; ! endif DATAOPT$="1"; ! set data option to 1 IF CVT(Y3$,128) <> "" THEN ! if 2nd data string DATAOPT$="2" ! set data option to 2 FI ! endif
00026 T1$=""; ! set 1st data heading to blank T2$=""; ! set 2nd data heading to blank T0$=""; ! set combined heading to blank T9$=T$+" "; ! add spaces to heading string IF POS(VIPSC$=T9$)=1 AND ! if there is a start char POS(VIPSC$=T9$(2))<>0 ! and an end char T9$=T9$(2); ! delete the start char T0=POS(VIPSC$=T9$); ! get pos of end char T0$=T9$(1,T0-1); ! set combined heading T9$=T9$(T0+1); ! and truncate from string IF POS(VIPSC$=T9$)=1 AND ! if there is a start char POS(VIPSC$=T9$(2))<>0 ! and an end char T9$=T9$(2); ! truncate start char T0=POS(VIPSC$=T9$); ! get pos of end char T1$=T9$(1,T0-1); ! set 1st data heading T9$=T9$(T0+1); ! and truncate from string IF POS(VIPSC$=T9$)=1 AND ! if there is a start char POS(VIPSC$=T9$(2))<>0 ! and an end char T9$=T9$(2); ! truncate start char T0=POS(VIPSC$=T9$); ! get pos of end char T2$=T9$(1,T0-1) ! set 2nd data heading FI ! endif FI ! endif FI; ! endif IF T0$="" ! if combined heading blank T0$=T$ ! set it to total heading string FI; ! endif IF T1$="" ! if 1st data heading blank T1$="Series 1" ! set it to Excel Std Series 1 FI; ! endif IF T2$="" ! if 2nd data heading blank T2$="Series 2" ! set it to Excel Std Series 2 FI ! endif
00029 IF W = 0 ! if 0 width W = 75 ! set to almost full width FI; ! endif IF H = 0 ! if 0 height H = 27 ! set to almost screen height FI; ! endif WIDTH=INT(W*72/12); ! calc width in points HEIGHT=INT(H*72/6); ! height HORZ=INT(C*72/12); ! characters VERT=INT(R*72/6) ! lines
00030 WINDOW CREATE (7,4,1,20) "NAME=EXCEL", ! create action window "BORDER=LG", "BORDERATR=FG"; ! with attributes PRINT @(0,0),'BF',@(0,0),"(GWW)",'ER',; ! and print gww status SETERR 1190; ! seterr to del window, exit SETESC 1190 ! setesc to del window, exit
00040 S$="SHEET1"; ! start with excel sheet 1 P$=CVT(P$,8+128); ! strip programname OPT$="NEW" ! set option =ew spreadsheet
01005 DIM MSG$[6]; ! dim GWW pass string EXNAME$="EXCEL.EXE"
01006 MSG$[1]="X"; ! function: get info MSG$[2]= EXNAME$; ! appl: excel ERREXIT$="Y"; ! set exit on error to yes GOSUB 02000; ! go get info from GWW R$=MSG$[5] ! get response from call
01010 MSG$[1]="I6"; ! function: initiate,ormal,o focus MSG$[2]= EXNAME$; ! appl: excel MSG$[3]="SYSTEM"; ! topic: system MSG$[4]=""; ! item: one MSG$[5]=""; ! data: one GOSUB 02000 ! call GWW
01021 MSG$[1]="E"; ! function: execute MSG$[3]="SYSTEM"; ! topic: system MSG$[5]="[ERROR(FALSE)]"+ ! data: turn Excel errors off "[A1.R1C1(FALSE)]"; ! + R1C1 reference GOSUB 2000 ! call GWW01022 MSG$[1]="R" ! function: retrieve MSG$[3]=S$; ! topic: sheetame MSG$[4]=VIPS ! set start sep char +"R1C1" ! + item: row 1, column 1 +VIPSC$; ! + end sep char GOSUB 02000 ! call GWW to get current sheet info
01024 X5$=MSG$[5]; ! set response IF LEN(X5$)=2 ! if only two chars X5$="" ! set response toone ELSE ! else X5$=CVT(X5$(2,LEN(X5$)-2),8+128) ! set last programname FI; ! endif IF POS(P$=X5$)<>1 ! if curr program <> this sheet pgm IF X5$="" ! if itso program OPT$="NEW"; ! set option =ew GOTO 01030 ! go process FI; ! endif S$="SHEET"+STR(NUM(S$(6))+1); ! add 1 to sheet id MSG$[3]=S$; ! set topic toext sheet ERREXIT$ = "N"; ! dont exit if error GOSUB 02000; ! call GWW to get thisame IF MSG$[0]="." ! if a good sheet GOTO 01024 ! goto check again ELSE ! else MSG$[1]="E"; ! function: execute MSG$[3]="SYSTEM"; ! topic: system MSG$[5]="[NEW(1,0)]"; !text: ew sheet GOSUB 02000; ! call GWW to createew sheet GOTO 01030 ! go process FI ! endif ELSE ! else OPT$="CURR" ! set option to curr sheet there FI ! endif
01030 X1$=Y1$+" "; ! add blanks to reference cells X2$=Y2$+" "; ! add blanks to 1st data cells X3$=Y3$+" "; ! add blanks to 2nd data cells R=0; ! set row to zero GOSUB 6000 ! set alpha location references
01040 PRINT @(1,1),"P..", ! print poke status in window01110 MSG$[1]="P"; ! function: poke MSG$[2]= EXNAME$; ! appl: excel MSG$[3]=S$; ! topic: sheetame MSG$[4]=""; ! start item string asull MSG$[5]=""; ! start data string asull WHILE POS(VIPSC$=X1$)<>0 ! while there is a good start ! seperator AND POS(VIPSC$=X1$(2))<>0; ! and a good end seperator P1=POS(VIPSC$=X1$); ! get start sep X1$=X1$(2); ! truncate it P2=POS(VIPSC$=X1$); ! get end sep R=R+1; ! add 1 to row MSG$[4]=MSG$[4]+VIPSC$ ! add to current string 1 sep ! char +"R"+STR(R)+"C2" ! + row and column id +VIPSC$; ! + end sep char X1$=X1$(P2+1); ! truncate this entry WEND; ! wend
R=0; ! set row to zero
WHILE POS(VIPSC$=X2$)<>0 ! while there is a good ! seperator AND POS(VIPSC$=X2$(2))<>0; ! and a good end seperator P1=POS(VIPSC$=X2$); ! get start sep X2$=X2$(2); ! truncate it P2=POS(VIPSC$=X2$); ! get end sep R=R+1; ! add 1 to row MSG$[4]= MSG$[4] ! add to curr string + VIPSC$ ! 1 sep char + "R" ! + row indicator + STR(R) ! + row id + "C3" ! + column + VIPSC$; ! + end sep char X2$=X2$(P2+1); ! truncate this entry WEND; ! wend
IF DATAOPT$ <> "1" ! if more than one data string R=0 ! reset row counter FI; ! endif
WHILE POS(VIPSC$=X3$)<>0 ! while there is a start char AND POS(VIPSC$=X3$(2))<>0; ! and an end char P1=POS(VIPSC$=X3$); ! get start char X3$=X3$(2); ! truncate it P2=POS(VIPSC$=X3$); ! get end char R=R+1; ! add 1 to row MSG$[4]=MSG$[4] ! add to current msg string +VIPSC$ ! 1 sep char +"R" ! + row id +STR(R) ! + rowumber +"C4" ! + column +VIPSC$; ! + end sep char X3$=X3$(P2+1); ! truncate this entry WEND; ! wend MSG$[5]=Y1$+Y2$+Y3$; ! set data strings GOSUB 02000; ! call GWW to send sheet id data MSG$[4]= VIPSC$ ! createew string with 1 sep ! char + "R1C1" ! + r1c1 indicator + VIPSC$ + VIPSC$ ! + 2 sep chars + "R2C1" ! + r2c1 indicator + VIPSC$ + VIPSC$ ! + 2 sep chars + "R3C1" ! + r3c1 indicator + VIPSC$; ! + end sep char MSG$[5]= VIPSC$ ! set data string with 1 sep ! char + P$ ! + sourcename + VIPSC$ + VIPSC$ ! + 2 sep chars + S$ ! + sheetame + VIPSC$ + VIPSC$ ! + 2 sep chars + T0$ ! + title + VIPSC$; ! + end sep char
GOSUB 02000; ! call GWW to set this data MSG$[1]="E"; ! function: execute MSG$[2]= EXNAME$; ! appl: excel MSG$[3]="SYSTEM"; ! topic: system MSG$[4]=""; ! item: one X$=""; ! initialize transmit string IF DATAOPT$<>"1" ! ifot one data column COL$="C4" ! select over to column 4 ELSE ! else COL$="C3" ! select over to column 3 FI; ! endif IF OPT$="NEW" ! if aew sheet X$=X$+"[ACTIVATE()]"; ! activate excel sheet X$=X$+"[FULL(TRUE)]"; ! set full option X$=X$+"[SELECT("+Q$+"R1C2:R"+STR(R)+COL$+Q$+")]"; ! select ! all data X$=X$+"[ALIGNMENT(4)]"; ! set alignment X$=X$+"[BORDER(FALSE,FALSE,FALSE,TRUE,FALSE,FALSE)]"; ! and ! border X$=X$+"[NEW(2,1)]"; ! create aew graph IF DATAOPT$="1" ! if only one data column X$=X$+"[GALLERY.3D.COLUMN(4)]"; ! type 3D column X$=X$+"[FORMAT.MAIN(8,1,0,50,TRUE,FALSE,FALSE)]" ELSE ! else X$=X$+"[GALLERY.COLUMN(1,TRUE)]"; ! type 2D column X$=X$+"[FORMAT.MAIN(3,1,0,50,TRUE,FALSE,FALSE)]" FI; ! endif X$=X$+"[ATTACH.TEXT(1)]"; ! attach for the title X$=X$+"[FORMULA("+Q$+"="+Q$+Q$+T0$+Q$+Q$+Q$+")]"; ! the ! reportname IF DATAOPT$<>"1" ! ifot single data graph ! created X$=X$+"[ACTIVATE("+Q$+S$+Q$+")]"; ! select each sheet X$=X$+"[SELECT("+Q$+"R1C2:R"+STR(R)+"C3"+Q$+")]"; X$=X$+"[NEW(2,1)]"; X$=X$+"[GALLERY.3D.COLUMN(4)]"; X$=X$+"[FORMAT.MAIN(8,1,0,50,TRUE,FALSE,FALSE)]"; X$=X$+"[ATTACH.TEXT(1)]"; X$=X$+"[FORMULA("+Q$+"="+Q$+Q$+T1$+Q$+Q$+Q$+")]"; X$=X$+"[ACTIVATE("+Q$+S$+Q$+")]"; X$=X$+"[SELECT("+Q$+"R1C2:R"+STR(R)+"C2,R1C4:R"+ STR(R)+"C4"+Q$+")]"; X$=X$+"[NEW(2,1)]"; X$=X$+"[GALLERY.3D.COLUMN(4)]"; X$=X$+"[FORMAT.MAIN(8,1,0,50,TRUE,FALSE,FALSE)]"; X$=X$+"[ATTACH.TEXT(1)]"; X$=X$+"[FORMULA("+Q$+"="+Q$+Q$+T2$+Q$+Q$+Q$+")]" FI ! endif FI; ! endif X$=X$+"[SELECT("+Q$+Q$+")]"; ! select the graph X$=X$+"[APP.RESTORE()]"; ! make it big X$=X$+"[APP.SIZE("+STR(WIDTH)+","+STR(HEIGHT)+")]"; ! size it X$=X$+"[APP.MOVE("+STR(HORZ)+","+STR(VERT)+")]"; ! and move ! it IF OPT$ = "NEW" ! if this isew sheet X$=X$+"[ACTIVATE("+Q$+S$+Q$+")]"; ! activate the data sheet X$=X$+"[HIDE()]"; ! and hide it X$=X$+"[ARRANGE.ALL()]" ! then arrange the rest FI; ! endif
X$=X$+"[APP.RESTORE()]"; ! restore the base sheet MSG$[5]=X$; ! set execute items GOSUB 02000; ! call GWW to format graph MSG$[1]="F"; ! function: focus to ensure ! display MSG$[2]= EXNAME$; ! appl: excel MSG$[3]="SYSTEM"; ! topic: system MSG$[4]=""; ! item: one MSG$[5]="%{ }{ENTER}"; ! alt, space, enter GOSUB 02000 ! send these keys to activate ! graph01190 WINDOW DELETE ("EXCEL"); ! delete the status window GOTO 09990 ! and exit02000 REM "GWW Transmit" ! call GWW02010 PRINT @(1,1), MSG$[1](1,1),".X",; ! print function code ! transmitted CALL"GWWCOM",MSG$[ALL]; ! call GWW with all parms PRINT @(1,1),"...",; ! clear function code ! transmitted IF MSG$[0]<>"." AND ERREXIT$="Y" ! ifot a good call & exit ! on err yes EXITTO 1190 ! exit at this time ELSE ! else ERREXIT$="Y"; ! set exit onext error to yes RETURN ! return FI ! endif
06000 REM "make sure refs are alpha ! check reference string for ! alphas06010 Y5$=Y1$+" "; ! set reference string + 2 ! blanks Y1$=""; ! clear original ref string WHILE POS(VIPSC$=Y5$)=1 AND ! while there is a start char POS(VIPSC$=Y5$(2))<>0; ! and an end char Y1$ = Y1$ ! add to previously decode ! string + Y5$(1,1) ! the start char + "=" ! + excel = sign for formula + Q$; ! + quote for text Y5$ = Y5$(2); ! truncate the start char Y5 = POS(VIPSC$=Y5$); ! find the end char Y1$ = Y1$ ! add to decoded string + Y5$(1,Y5-1) ! the remainder of the ! formula + Q$ ! + end quote for text + Y5$(Y5,1); ! + end character Y5$ = Y5$(Y5+1); ! and set the remainder of ! source WEND; ! wend RETURN ! return09990 EXIT ! exit graphic routine09999 END ! endFrom the Gateway for Windows Reference, version 8.9.1. Open this page in the PDF