User Tools

Site Tools


converting_20programs_20from_20risc_20os_20to_20windows

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

converting_20programs_20from_20risc_20os_20to_20windows [2018/03/31 13:19]
127.0.0.1 external edit
converting_20programs_20from_20risc_20os_20to_20windows [2018/04/14 20:49] (current)
richardrussell Added syntax highlighting
Line 1: Line 1:
 =====Converting programs from RISC OS to Windows===== =====Converting programs from RISC OS to Windows=====
  
-//by Richard Russell, October 2009//\\ \\  The conversion of **WIMP-based** BBC BASIC programs (i.e. programs having a Graphical User Interface) from **RISC OS** to **Windows** is a very broad subject, and it would be virtually impossible to provide a comprehensive guide. Therefore this article takes the form of a Case Study, dealing specifically with the conversion of one program: **BasCalc**. BasCalc is a relatively simple application,​ but it is hoped that the techniques used in its conversion to Windows may be applicable to other programs.\\ \\  Sections of the program that require alteration will be listed in their '​before'​ and '​after'​ forms, with an explanation of the changes. Line numbers will be retained, partly because the original version had them and partly for the convenience of being able to refer to the program by that means. However they are not required in the final (Windows) version and may be removed using the Renumber utility if desired.\\ \\  Unfortunately this Wiki doesn'​t provide a means to annotate the **RISC OS** and **Windows** code differently (for example using different colours). Therefore you may find it more satisfactory to compare the two versions using a utility like [[http://​www.microsoft.com/​downloads/​details.aspx?​FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&​displaylang=en|WinDiff]],​ which highlights the differences. To enable you to do that the two programs are available for download as plain-text files as follows: [[http://​www.rtr.myzen.co.uk/​BASCalc_RISCOS.bas|BASCalc_RISCOS.bas]] and [[http://​www.rtr.myzen.co.uk/​BASCalc_Windows.bas|BASCalc_Windows.bas]]\\ \\  Firstly here are some screenshots of the RISC OS and Windows versions for comparison:​\\ \\ {{bascalc1.png}}{{bascalc4.png}}\\ {{bascalc2.png}}{{bascalc5.png}}\\ \\  Now for the conversion. The first few lines require no alteration:\\ \\ +//by Richard Russell, October 2009//\\ \\  The conversion of **WIMP-based** BBC BASIC programs (i.e. programs having a Graphical User Interface) from **RISC OS** to **Windows** is a very broad subject, and it would be virtually impossible to provide a comprehensive guide. Therefore this article takes the form of a Case Study, dealing specifically with the conversion of one program: **BasCalc**. BasCalc is a relatively simple application,​ but it is hoped that the techniques used in its conversion to Windows may be applicable to other programs.\\ \\  Sections of the program that require alteration will be listed in their '​before'​ and '​after'​ forms, with an explanation of the changes. Line numbers will be retained, partly because the original version had them and partly for the convenience of being able to refer to the program by that means. However they are not required in the final (Windows) version and may be removed using the Renumber utility if desired.\\ \\  Unfortunately this Wiki doesn'​t provide a means to annotate the **RISC OS** and **Windows** code differently (for example using different colours). Therefore you may find it more satisfactory to compare the two versions using a utility like [[http://​www.microsoft.com/​downloads/​details.aspx?​FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&​displaylang=en|WinDiff]],​ which highlights the differences. To enable you to do that the two programs are available for download as plain-text files as follows: [[http://​www.rtr.myzen.co.uk/​BASCalc_RISCOS.bas|BASCalc_RISCOS.bas]] and [[http://​www.rtr.myzen.co.uk/​BASCalc_Windows.bas|BASCalc_Windows.bas]]\\ \\  Firstly here are some screenshots of the RISC OS and Windows versions for comparison:​\\ \\ {{bascalc1.png}}{{bascalc4.png}}\\ {{bascalc2.png}}{{bascalc5.png}}\\ \\  Now for the conversion. The first few lines require no alteration: 
 + 
 +<code bb4w>
      10 REM >BASCalc Source code      10 REM >BASCalc Source code
      20 REM (C)1999 PAUL VIGAY      20 REM (C)1999 PAUL VIGAY
Line 8: Line 10:
      50 REM create your own applications. A limited number of comments have been inserted for you!      50 REM create your own applications. A limited number of comments have been inserted for you!
      60 version$="​1.05 (12th Mar 2006)" : ver$=LEFT$(version$,​4)      60 version$="​1.05 (12th Mar 2006)" : ver$=LEFT$(version$,​4)
-The first line to require a change is this one:\\ \\ +</​code>​ 
 + 
 +The first line to require a change is this one: 
 + 
 +<code bb4w>
      70 DIM pb1% 256 : task%=&​4B534154 : path$="<​BASCalc$Path>​."​      70 DIM pb1% 256 : task%=&​4B534154 : path$="<​BASCalc$Path>​."​
      70 DIM pb1% 256 : task%=&​4B534154 : path$=@dir$      70 DIM pb1% 256 : task%=&​4B534154 : path$=@dir$
-The RISC OS path specification isn't appropriate for Windows. Under Windows it could be set to an absolute or relative path, but for convenience here we simply set it to **@dir$**, which in BB4W is a pre-defined '​system'​ variable containing the directory from which the program was loaded. Neither **pb1%** nor **task%** are required in the Windows version (in fact, **pb1%** isn't used even in the RISC OS version!) and can be retained or deleted as preferred.\\ \\ +</​code>​ 
 + 
 +The RISC OS path specification isn't appropriate for Windows. Under Windows it could be set to an absolute or relative path, but for convenience here we simply set it to **@dir$**, which in BB4W is a pre-defined '​system'​ variable containing the directory from which the program was loaded. Neither **pb1%** nor **task%** are required in the Windows version (in fact, **pb1%** isn't used even in the RISC OS version!) and can be retained or deleted as preferred. 
 + 
 +<code bb4w>
      80 SYS "​Wimp_Initialise",​200,​task%,"​BASCalc"​ TO ,​task_handle%      80 SYS "​Wimp_Initialise",​200,​task%,"​BASCalc"​ TO ,​task_handle%
      80 SYS "​SetWindowText",​ @hwnd%, "​BASCalc"​      80 SYS "​SetWindowText",​ @hwnd%, "​BASCalc"​
-Windows has no direct equivalent to **Wimp_Initialise** so here we replace the call with one which sets the window title.\\ \\ +</​code>​ 
 + 
 +Windows has no direct equivalent to **Wimp_Initialise** so here we replace the call with one which sets the window title. 
 + 
 +<code bb4w>
      90 PROCinit      90 PROCinit
     100 ON ERROR PROCerror     100 ON ERROR PROCerror
Line 24: Line 38:
     110 REPEAT     110 REPEAT
     120   ​reason% = FNwimp_poll(pb%)     120   ​reason% = FNwimp_poll(pb%)
-Because Windows is a //​pre-emptive//​ OS rather than a //​co-operative//​ OS it has no direct equivalent to Wimp_Poll. However, to maintain the structure of the program, and to reduce the extent of the alterations as far as possible, the call is replaced by the function **FNwimp_poll** which we shall see later. Lines 90 and 100 have been swapped so that any errors occurring in **PROCinit** will be properly reported.\\ \\ +</​code>​ 
 + 
 +Because Windows is a //​pre-emptive//​ OS rather than a //​co-operative//​ OS it has no direct equivalent to Wimp_Poll. However, to maintain the structure of the program, and to reduce the extent of the alterations as far as possible, the call is replaced by the function **FNwimp_poll** which we shall see later. Lines 90 and 100 have been swapped so that any errors occurring in **PROCinit** will be properly reported. 
 + 
 +<code bb4w>
     130   CASE reason% OF     130   CASE reason% OF
     140     WHEN 2:​PROCopen(pb%!0)     140     WHEN 2:​PROCopen(pb%!0)
Line 49: Line 67:
     190     WHEN 17: end%=TRUE     190     WHEN 17: end%=TRUE
     290   ​ENDCASE     290   ​ENDCASE
-There are no essential changes here, but for neatness lines 140-150 and 190-280 have been deleted. These perform operations needed to support RISC OS which are not required under Windows. It would do no harm, other than leaving '​dead'​ code, to retain them since the associated '​reason codes' won't be generated by **FNwimp_poll**.\\ \\ +</​code>​ 
 + 
 +There are no essential changes here, but for neatness lines 140-150 and 190-280 have been deleted. These perform operations needed to support RISC OS which are not required under Windows. It would do no harm, other than leaving '​dead'​ code, to retain them since the associated '​reason codes' won't be generated by **FNwimp_poll**. 
 + 
 +<code bb4w>
     300 UNTIL end%     300 UNTIL end%
     310 PROCmsgend:​@%=at%:​SYS "​Wimp_CloseDown",​task_handle%,​task%     310 PROCmsgend:​@%=at%:​SYS "​Wimp_CloseDown",​task_handle%,​task%
Line 56: Line 78:
     300 UNTIL end%     300 UNTIL end%
     310 QUIT     310 QUIT
-Here we can simply replace the calls to **Wimp_CloseDown** and **PROCmsgend** with QUIT. In a more complex program it may well be necessary to perform some '​cleanup'​ operations before exit, even in the Windows version.\\ \\ +</​code>​ 
 + 
 +Here we can simply replace the calls to **Wimp_CloseDown** and **PROCmsgend** with QUIT. In a more complex program it may well be necessary to perform some '​cleanup'​ operations before exit, even in the Windows version. 
 + 
 +<code bb4w>
     330     330
     340 DEF PROCmouseclick     340 DEF PROCmouseclick
Line 67: Line 93:
     350 LOCAL i%     350 LOCAL i%
     360 i%=pb%!16     360 i%=pb%!16
-For the mouse-click processing the information required by the Windows version is much simpler than by the RISC OS version, basically it's a single value (here **i%**) to indicate what **control** (**icon** in RISC OS-speak) was clicked. Again, there'​s not actually any need to make changes but for clarity the unnecessary variables have been deleted.\\ \\ +</​code>​ 
 + 
 +For the mouse-click processing the information required by the Windows version is much simpler than by the RISC OS version, basically it's a single value (here **i%**) to indicate what **control** (**icon** in RISC OS-speak) was clicked. Again, there'​s not actually any need to make changes but for clarity the unnecessary variables have been deleted. 
 + 
 +<code bb4w>
     380 CASE b% OF     380 CASE b% OF
     390   WHEN 1,4:CASE w% OF     390   WHEN 1,4:CASE w% OF
Line 114: Line 144:
     600 ENDCASE     600 ENDCASE
     670 ENDPROC     670 ENDPROC
-The only necessary change to this code is the substitution of the calls to **Wimp_SetCaretPosition** (lines 470 and 580) with a suitable Windows equivalent. In fact, since these calls are non-essential,​ for convenience (and laziness!) they have here simply been deleted.\\ \\  However, in Windows, the outer **CASE b% OF** and **CASE w% OF** constructs aren't required, so for neatness and clarity lines 380-440 and 610-660 have been removed and in line 450 the **WHEN window%(2)** has been deleted. Again, it would do no harm to retain this '​dead'​ code (so long as the original lines 350 and 360 are kept) because **FNwimp_poll** does not return values which would cause it to be activated.\\ \\ +</​code>​ 
 + 
 +The only necessary change to this code is the substitution of the calls to **Wimp_SetCaretPosition** (lines 470 and 580) with a suitable Windows equivalent. In fact, since these calls are non-essential,​ for convenience (and laziness!) they have here simply been deleted.\\ \\  However, in Windows, the outer **CASE b% OF** and **CASE w% OF** constructs aren't required, so for neatness and clarity lines 380-440 and 610-660 have been removed and in line 450 the **WHEN window%(2)** has been deleted. Again, it would do no harm to retain this '​dead'​ code (so long as the original lines 350 and 360 are kept) because **FNwimp_poll** does not return values which would cause it to be activated. 
 + 
 +<code bb4w>
     680     680
     690 DEF PROCkeypressed     690 DEF PROCkeypressed
Line 124: Line 158:
     700 LOCAL icon%     700 LOCAL icon%
     710 icon%=pb%!4     710 icon%=pb%!4
-Here we have a very similar situation to **PROCmouseclick**;​ once again the information required by the Windows version is simpler than the RISC OS version: just the control (icon) into which input was entered (**icon%**). In Windows, handling of keyboard input to an 'edit box' does not require the attention of the main program. Checking that the key pressed was Return (Enter), which in the RISC OS version was done here, has been transferred into **FNwimp_poll** in the Windows version.\\ \\ +</​code>​ 
 + 
 +Here we have a very similar situation to **PROCmouseclick**;​ once again the information required by the Windows version is simpler than the RISC OS version: just the control (icon) into which input was entered (**icon%**). In Windows, handling of keyboard input to an 'edit box' does not require the attention of the main program. Checking that the key pressed was Return (Enter), which in the RISC OS version was done here, has been transferred into **FNwimp_poll** in the Windows version. 
 + 
 +<code bb4w>
     720 CASE window% OF     720 CASE window% OF
     730   WHEN window%(2):​CASE key% OF     730   WHEN window%(2):​CASE key% OF
Line 154: Line 192:
     820 ENDCASE     820 ENDCASE
     890 ENDPROC     890 ENDPROC
-Once again the only essential change is the substitution or removal of **Wimp_SetCaretPosition** (line 830) but here the superfluous **CASE window% OF** and **CASE key% OF** constructs (lines 720-730 and 830-880) and the **WHEN 13** (in line 740) have been deleted. The **Wimp_ProcessKey** has no equivalent in Windows (it is related to the co-operative nature of RISC OS).\\ \\ +</​code>​ 
 + 
 +Once again the only essential change is the substitution or removal of **Wimp_SetCaretPosition** (line 830) but here the superfluous **CASE window% OF** and **CASE key% OF** constructs (lines 720-730 and 830-880) and the **WHEN 13** (in line 740) have been deleted. The **Wimp_ProcessKey** has no equivalent in Windows (it is related to the co-operative nature of RISC OS). 
 + 
 +<code bb4w>
     900     900
     910 DEF PROCmenu     910 DEF PROCmenu
Line 194: Line 236:
    1070 ENDCASE    1070 ENDCASE
    1080 ENDPROC    1080 ENDPROC
-This is the first major change. Since the means of displaying and processing a //context// menu is quite different, **PROCmenu** has been substantially re-written. In Windows the context menu is displayed by clicking the //right// mouse button.\\ \\ +</​code>​ 
 + 
 +This is the first major change. Since the means of displaying and processing a //context// menu is quite different, **PROCmenu** has been substantially re-written. In Windows the context menu is displayed by clicking the //right// mouse button. 
 + 
 +<code bb4w>
    1090    1090
    1100 DEF PROCinit    1100 DEF PROCinit
Line 221: Line 267:
    1210 SYS "​CheckMenuItem",​ menu2%, 200+decimals%,​ 8    1210 SYS "​CheckMenuItem",​ menu2%, 200+decimals%,​ 8
    1220 ENDPROC    1220 ENDPROC
-Here the changes consist mostly of (optional) deletions. The allocation of buffers in lines 1120 to 1150 is not required (along with most of line 1110); **PROCmsgload** can be dispensed with (as we will see later, the most convenient way of emulating the RISC OS **MessageTrans** facility does not require initialisation) and Windows looks after its iconbar (task bar) without user involvement.\\ \\  A couple of additions have also been made: **showfull%=FALSE** (line 1180) and **PROCsizewindow** (line 1190) initialise the size of the window, and **SYS "​CheckMenuItem"​** (line 1210) initialises the '​tick'​ against the default number of decimal places in the relevant sub-menu (**menu2%**).\\ \\ +</​code>​ 
 + 
 +Here the changes consist mostly of (optional) deletions. The allocation of buffers in lines 1120 to 1150 is not required (along with most of line 1110); **PROCmsgload** can be dispensed with (as we will see later, the most convenient way of emulating the RISC OS **MessageTrans** facility does not require initialisation) and Windows looks after its iconbar (task bar) without user involvement.\\ \\  A couple of additions have also been made: **showfull%=FALSE** (line 1180) and **PROCsizewindow** (line 1190) initialise the size of the window, and **SYS "​CheckMenuItem"​** (line 1210) initialises the '​tick'​ against the default number of decimal places in the relevant sub-menu (**menu2%**). 
 + 
 +<code bb4w>
    1230    1230
    1240 DEF FNiconbar(A$)    1240 DEF FNiconbar(A$)
Line 267: Line 317:
    1640 bhandle%=pb%!28:​flags%=pb%!32    1640 bhandle%=pb%!28:​flags%=pb%!32
    1650 ENDPROC    1650 ENDPROC
-This code is specific to RISC OS and can be **deleted in its entirety**. The program will still work correctly if it is left, but doing so will waste a substantial amount of memory and potentially cause confusion to somebody reading the code.\\ \\ +</​code>​ 
 + 
 +This code is specific to RISC OS and can be **deleted in its entirety**. The program will still work correctly if it is left, but doing so will waste a substantial amount of memory and potentially cause confusion to somebody reading the code. 
 + 
 +<code bb4w>
    1660    1660
    1670 DEF PROCui(window%,​icon%,​ptr%,​text$)    1670 DEF PROCui(window%,​icon%,​ptr%,​text$)
Line 277: Line 331:
    1680 SYS "​SetDlgItemText",​ window%, icon%, text$    1680 SYS "​SetDlgItemText",​ window%, icon%, text$
    1690 ENDPROC    1690 ENDPROC
-Here the original code has been substituted with a Windows near-equivalent.\\ \\ +</​code>​ 
 + 
 +Here the original code has been substituted with a Windows near-equivalent. 
 + 
 +<code bb4w>
    1700    1700
    1710 REM Setup messagetrans    1710 REM Setup messagetrans
Line 290: Line 348:
    1800 SYS "​XMessageTrans_CloseFile",​msgdesc%:​SYS "​XOS_Module",​7,,​msgdesc%    1800 SYS "​XMessageTrans_CloseFile",​msgdesc%:​SYS "​XOS_Module",​7,,​msgdesc%
    1810 ENDPROC    1810 ENDPROC
-This code is not required and may be **deleted**.\\ \\ +</​code>​ 
 + 
 +This code is not required and may be **deleted**. 
 + 
 +<code bb4w>
    1820    1820
    1830 REM decode tag$ into relevant text from Messages file    1830 REM decode tag$ into relevant text from Messages file
Line 305: Line 367:
    1860 SYS "​GetPrivateProfileString","​messages",​tag$,"",​msgtext%,​256,​path$+"​BASCalc.ini"​    1860 SYS "​GetPrivateProfileString","​messages",​tag$,"",​msgtext%,​256,​path$+"​BASCalc.ini"​
    1890 = $$msgtext%    1890 = $$msgtext%
-A convenient way of emulating the RISC OS **MessageTrans** facility is to use a file in the Windows '​.INI'​ format. Here we are using such a file called **BASCalc.ini** in which the mesages are contained in a section called **messages** (the file is listed at the end of this article). Note the use of **$$** rather than **$** in line 1890.\\ \\ +</​code>​ 
 + 
 +A convenient way of emulating the RISC OS **MessageTrans** facility is to use a file in the Windows '​.INI'​ format. Here we are using such a file called **BASCalc.ini** in which the mesages are contained in a section called **messages** (the file is listed at the end of this article). Note the use of **$$** rather than **$** in line 1890. 
 + 
 +<code bb4w>
    1900    1900
    1910 DEF FNgetstring(a%)    1910 DEF FNgetstring(a%)
Line 313: Line 379:
    1950    1950
    1960 DEF PROCstring0(a%,​a$) $a%=a$:​a%?​LENa$=0:​ENDPROC    1960 DEF PROCstring0(a%,​a$) $a%=a$:​a%?​LENa$=0:​ENDPROC
-These routines may be **deleted**. BBC BASIC for Windows supports NUL-terminated strings natively using the **$$** syntax.\\ \\ +</​code>​ 
 + 
 +These routines may be **deleted**. BBC BASIC for Windows supports NUL-terminated strings natively using the **$$** syntax. 
 + 
 +<code bb4w>
    1970    1970
    1980 DEF PROCerror    1980 DEF PROCerror
Line 332: Line 402:
    2030 IF E%=2 OR end%=TRUE end%=TRUE:​@%=at%:​QUIT    2030 IF E%=2 OR end%=TRUE end%=TRUE:​@%=at%:​QUIT
    2040 ENDPROC    2040 ENDPROC
-The only alterations required here are to delete the **PROCmsgend:​SYS "​Wimp_CloseDown"​** and change **END** to **QUIT**. In a more complex program it may be necessary to call a '​cleanup'​ routine before exit.\\ \\ +</​code>​ 
 + 
 +The only alterations required here are to delete the **PROCmsgend:​SYS "​Wimp_CloseDown"​** and change **END** to **QUIT**. In a more complex program it may be necessary to call a '​cleanup'​ routine before exit. 
 + 
 +<code bb4w>
    2050    2050
    2060 DEF FNerror(E%,​N%,​M$)    2060 DEF FNerror(E%,​N%,​M$)
Line 343: Line 417:
    2070 SYS "​MessageBox",​ @hwnd%, M$, "Error "​+STR$(N%),​ 49 TO E%    2070 SYS "​MessageBox",​ @hwnd%, M$, "Error "​+STR$(N%),​ 49 TO E%
    2090 =E%    2090 =E%
-Here **SYS "​Wimp_ReportError"​** has been substituted with **SYS "​MessageBox"​**. Fortunately the codes returned for OK (1) and CANCEL (2) are the same as in RISC OS!\\ \\ +</​code>​ 
 + 
 +Here **SYS "​Wimp_ReportError"​** has been substituted with **SYS "​MessageBox"​**. Fortunately the codes returned for OK (1) and CANCEL (2) are the same as in RISC OS! 
 + 
 +<code bb4w>
    2100    2100
    2110 DEF PROCmenucreate    2110 DEF PROCmenucreate
Line 416: Line 494:
    2290 SYS "​AppendMenu",​ menu1%, 0, 109, "&​Quit"​    2290 SYS "​AppendMenu",​ menu1%, 0, 109, "&​Quit"​
    2300 ENDPROC    2300 ENDPROC
-This is another case where the RISC OS and Windows code is quite different. Also, an extra menu item (**Show full**) has been added to the Windows version as a more convenient way of switching between the two window sizes.\\ \\ +</​code>​ 
 + 
 +This is another case where the RISC OS and Windows code is quite different. Also, an extra menu item (**Show full**) has been added to the Windows version as a more convenient way of switching between the two window sizes. 
 + 
 +<code bb4w>
    2590    2590
    2600 DEF PROCloadwindows    2600 DEF PROCloadwindows
Line 470: Line 552:
    2755 window%(2) = !window%    2755 window%(2) = !window%
    2760 ENDPROC    2760 ENDPROC
-Once again the Windows version is quite different. Although it's possible in Windows to create a dialogue window using a template (which would be more similar to the RISC OS version) it's conventional in BB4W to incorporate the various controls using inline code as shown. ​\\ \\ +</​code>​ 
 + 
 +Once again the Windows version is quite different. Although it's possible in Windows to create a dialogue window using a template (which would be more similar to the RISC OS version) it's conventional in BB4W to incorporate the various controls using inline code as shown. 
 + 
 +<code bb4w>
    2780    2780
    2790 DEF PROCcalc    2790 DEF PROCcalc
Line 493: Line 579:
    ....    ....
    4230 =a$    4230 =a$
-Lines 2780 to 4230 inclusive are the '​meat'​ of the BASCalc application and **require no changes**.\\ \\ +</​code>​ 
 + 
 +Lines 2780 to 4230 inclusive are the '​meat'​ of the BASCalc application and **require no changes**. 
 + 
 +<code bb4w>
    4240    4240
    4250 DEF PROCinsertcode(a$)    4250 DEF PROCinsertcode(a$)
Line 505: Line 595:
    4270 IF a$<>""​ FOR N%=1 TO LEN(a$):SYS "​PostMessage",​Focus%,​258,​ASC(MID$(a$,​N%,​1)),​0:​NEXT N%    4270 IF a$<>""​ FOR N%=1 TO LEN(a$):SYS "​PostMessage",​Focus%,​258,​ASC(MID$(a$,​N%,​1)),​0:​NEXT N%
    4280 ENDPROC    4280 ENDPROC
-The **SYS "​OS_Byte"​** has been substituted with a Windows equivalent (258 is WM_CHAR).\\ \\ +</​code>​ 
 + 
 +The **SYS "​OS_Byte"​** has been substituted with a Windows equivalent (258 is WM_CHAR). 
 + 
 +<code bb4w>
    4290    4290
    4300 DEF PROCloadchoices    4300 DEF PROCloadchoices
Line 526: Line 620:
    4320 SYS "​GetPrivateProfileInt","​choices","​showfull",​0,​path$+"​BASCalc.ini"​ TO showfull%    4320 SYS "​GetPrivateProfileInt","​choices","​showfull",​0,​path$+"​BASCalc.ini"​ TO showfull%
    4330 ENDPROC    4330 ENDPROC
-The Windows code is again quite different. In addition to loading the user's preference as regards the **decimals** setting, his most recent choice for the window size is also loaded.\\ \\ +</​code>​ 
 + 
 +The Windows code is again quite different. In addition to loading the user's preference as regards the **decimals** setting, his most recent choice for the window size is also loaded. 
 + 
 +<code bb4w>
    4430    4430
    4440 DEF PROCsavechoices    4440 DEF PROCsavechoices
Line 544: Line 642:
    4470 SYS "​WritePrivateProfileString","​choices","​showfull",​STR$showfull%,​path$+"​BASCalc.ini"​    4470 SYS "​WritePrivateProfileString","​choices","​showfull",​STR$showfull%,​path$+"​BASCalc.ini"​
    4480 ENDPROC    4480 ENDPROC
-Here the user's most recent window size setting is saved in addition to the number of decimal places.\\ \\  Finally here are the **FNwimp_poll**,​ **FNtrackpopupmenu** and **PROCsizewindow** routines which are specific to the Windows version:\\ \\ +</​code>​ 
 + 
 +Here the user's most recent window size setting is saved in addition to the number of decimal places.\\ \\  Finally here are the **FNwimp_poll**,​ **FNtrackpopupmenu** and **PROCsizewindow** routines which are specific to the Windows version: 
 + 
 +<code bb4w>
         DEF FNwimp_poll(pb%)         DEF FNwimp_poll(pb%)
         LOCAL click%, reason%, fg%, L%         LOCAL click%, reason%, fg%, L%
Line 612: Line 714:
         SYS "​SetWindowPos",​ @hwnd%, 0, 0, 0, rc.r%-rc.l%,​ rc.b%-rc.t%,​ 6         SYS "​SetWindowPos",​ @hwnd%, 0, 0, 0, rc.r%-rc.l%,​ rc.b%-rc.t%,​ 6
         ENDPROC         ENDPROC
-Here is what **BASCalc.ini** looks like; it may be compared with the equivalent RISC OS message file:\\ \\ +</​code>​ 
 + 
 +Here is what **BASCalc.ini** looks like; it may be compared with the equivalent RISC OS message file: 
 + 
 +<​code>​
   [messages]   [messages]
   # Messages file for !BASCalc   # Messages file for !BASCalc
Line 657: Line 763:
   decimals=8   decimals=8
   showfull=-1   showfull=-1
 +</​code>​
converting_20programs_20from_20risc_20os_20to_20windows.txt · Last modified: 2018/04/14 20:49 by richardrussell