"John W. Hardy" wrote:
A friend of mine wrote an extensive CAD program using HP-Pascal back in the mid 1980s. The program was used exclusively on HP workstations. HP had two variations of Pascal. One was a standalone operating environment, the other worked under HPUX. The CAD program was developed under the workstation version.
My friend would like to move this program to the PC world. One approach is "P2C" which converts HP-Pascal code to C. I just discovered GPC and would like to know if it is fairly compatible with HP-Pascal. I'm sure there would be a ton of rewriting that would be necessary whether the P2C or GPC approach is taken, but I would like to get a general idea of GPC compatibility. Thank you very much.
HPs Pascal was originally developed by Bob Fraley, and is basically ISO 7185 standard Pascal. I believe the only syntax extensions were the OTHERWISE clause for case statements, the array[firstindex FOR length] subarray construct, and provision for separate compilation by an isolated '.' ending the compilation without a normal outer code block. His original implementation made OTHERWISE a reserved word, which I avoided in PascalP at the cost of context sensitivity.
Any added standard procedures would be fairly system specific, although somebody mentioned 'overprint'. This simply flushes a line with a terminal <cr>, rather than a <crlf> combination (as from writeln), so that a following line overprints. 'prompt' is in the same category, except that no line termination characters are used, and is analagous to the C fflush() function. write, writeln, overprint, prompt should all share the same user syntax, with the difference being the handling of the output buffer and line termination characters. My memory has some dropped bits however.