Positron Code Update (PCU) - Update older Proton programs to V3.7.5.5/Positron

Started by Stephen Moss, May 29, 2022, 02:19 PM

Previous topic - Next topic

Stephen Moss

Hello everyone,
about 4 years ago someone mentioned having a lot of files created with older version of Proton that would need updating by hand due to changes made as the compiler developed over the years. Although I did not have many files that may need this doing to them I did think about how inconvenient that could be if I needed to revisit some old code and so I started writing something to do a lot (but not necessarily all) of the work for me, the result is the Positron Code Update (PCU).
PCU will...
1) Insert any missing mandatory declares (non optional).
2) Insert a warning about the HBUS command Legacy status (non optional).
3) Insert either a warning or replacement partial code (needs completing by user to restore functionality) for the now obsolete All_Digital command (users choice of option).
4) Retain traditional GoSub commands or replace with the newer Sub-EndSub version (users choice, but Sub-EndSub is compatible with code folding in Positron Studio).
5) Insert a warning about the Legacy status of Parameter Passing GoSub's or replace with the newer Procedures that work with all PIC types (users choice).
6) Miscellaneous additional changes for Proton to Positron compatibility (User chioce - this option will result in errors if compiled with Proton).
7) Gives the user the option to process either a single file or all files of the selected type located in the same folder and to retain or overwrite any previously converted files.

The converted fils are saved in a subfolder called "Converted", located within the folder containing the selected file, leaving the original unaltered incase you needed to go back to it. 

PCU is a standalone Windows executable (.exe) file but it can be installed as a Tool in Positron Studio for easy access and can be downloaded from here should anyone else find it useful.
 
The software has been tested as much as it can be by one person, consequently I cannot guarantee that is free from defects or suitable for the purpose for which you are using it. Particularly with the Gosub to Proceedures change as that was rather difficult to impliment.






rick.curl

Hi Stephen-
This looks to be very useful, but when I run it I get:
Process Gosub Parameter Subs Error
Index was out of range.  Must be non-negative and less than the size of the collection.
Parameter name: index

What should I do to resolve this?

Thanks.

-Rick

Stephen Moss

Hi Rick,
not sure it has been a while since I wrote it but it sounds like it may be trying to process an array of parameter passing subroutine names that has no data.

A quick test of the source code using my original test file and an edited version with parameter passing GoSubs removed which I thought might replicate that error if that were the issue were both processed without issue. I was unable to test the download as company PC did not like the fact the security certificate has expired.

I will take a look when I have time, in the mean time if you know the code for that file does not contain any parameter passing subroutines you could try  unchecking the "Replace GoSub [Paramters]" option from the option menu and see if it passes the file without errors.   

As it passes my test files without issue maybe there is something specific about that file that is throwing my code off track, are you having trouble with just that one file or does the same error appear regardless of which file you try to process?
 



 

rick.curl

Hi Stephen-

Unchecking the "Replace GoSub [Paramters]" option seems to have fixed it. 

Thank you!!

-Rick