Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Splitting Long Lines - the unquoted backslash ()?
Page 2 of 2 | |||||
Author | Message | ||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5867 |
If I added line continuation to MMEdit, you would be tied to MMEdit for everything. I will add word-wrap to the next update. That way the code doesn't end up with extraneous characters in it. Much safer. Jim VK7JH MMedit MMBasic Help |
||||
Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
Peter ... the point is not obvious unless you had the pleasure of writing code under the ancient DOSPLUS. It was line number oriented, but it would use tab and arrow characters in a code line to manipulate the display so that you could display a single code line on multiple lines in the display. You could structure code visually without having the structures actually implemented in the actual parsing of the language. With the structures in MMBasic this is of reduced interest except in the case of visualizing print statements. Anyway, you answered my original question ... the TAB is converted to spaces (white space), but arrow keys are seen values above &h7F and used internally in some commands (like INPUT$) which precludes their being used for display tricks. Apparently, the DOSPLUS interpreter lexically regarded the down arrow as white space but could preserve it and recognize it when displaying a line of code. As I recall the DOSPLUS BASIC (loaded from disk) was about three times faster than the very early microsoft basic which was present on ROM in the TRS80 model III. Beginning about 1979 my wife, a CPA, and I co-authored an income tax calculation program. We leased Model IIIs, a dot matrix printer, and the program on floppy to accounting firms in the NYC area. In those days an accounting firm would punch tax data into mini-Hollerith cards (IBM System 3 type), transmit them via dial up modem to a mainframe owned by Commerce Clearing House, and wait days for printed output to return via snail mail. This program enabled them to see results in a few minutes. It was long before the first laser printers so it was not possible for it to actually prepare submissable forms for the IRS. Paul in NY Paul in NY |
||||
Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
I will add word-wrap to the next update. That way the code doesn't end up with extraneous characters in it. Much safer. Jim Hey Jim, display word wrap might be useful because it would not actually alter the line of code, just change the way it is displayed. You might fool around with displaying either a bunch of spaces or some high end 8 bit display characters like 0xAF, Alt + 0187, or some un-editable character to indicate that it is a continuation line. (This website won't let me paste any high bit characters.) Just don't actually alter the code. Paul in NY |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1081 |
It was line number oriented, but it would use tab and arrow characters in a code line to manipulate the display so that you could display a single code line on multiple lines in the display. My familiarity is with Apple ][ and Applesoft. Something partially similar was possible. 'Special' characters could be embedded after REM statements, allowing some interesting possibilities, such as formatting but also minor code obscuring. For example, after a simple but critical statement, you could add a REM followed by a number of back space characters, then a new fake statement that would hide the real one and the REM. Trivial to circumvent if you knew it was there but still... Btw, I always enjoy your stories of the way the computer world was. They really ought to be collected together. Visit Vegipete's *Mite Library for cool programs. |
||||
Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
@vegipete ... Back in 1979 I avoided the Apple because the available basic did not provide double precision arithmetic. My idea was to provide something which my wife, Sonja, could use at work in a large CPA firm. CPAs and lawyers understand that you can't divide by 3 or 7 (or their multiples) in a base 10 numbering system. You get a repeating decimal. They get bumfuzzled when they find that you can't divide by 3, 5, or 7 in a base 2 numbering system. The answer was to calculate in base 2 to many more bits than needed then convert back to base 10 with many more decades than needed and then round the end result. Rounding could best be done with the typical PRINT USING "###,###.##" command in Microsoft basic. (Beginning in 1980 Wayne Ratliff wrote Vulcan which sidestepped the problems associated with conversion from base 10 to base 2 and back to base 10 by encoding binary coded decimal math routines which emulate base 10 math and produce the same base 10 errors CPAs are familiar with.) I then looked for a mass produced box which was self contained and required a minimum number of cable connections. The Radio Shack TRS80 model III would work with just a printer cable and a line power plug and it had Microsoft Basic ready to go in a ROM chip. When we got the program working properly we would up leasing 10 of them complete with floppy drives and dot matrix printers to a few accounting firms. The first time they were fired up people would come running from all over the office when the dot matrix printer started pecking its way across the fan fold paper. CPAs had never heard anything like it before. It was great fun and very profitable for about a decade. Paul in NY Edited 2021-04-27 04:05 by Paul_L |
||||
MustardMan Senior Member Joined: 30/08/2019 Location: AustraliaPosts: 175 |
My idea was something like... IF Parameter1 > P1_Limit AND _ ' Temperature of the freezer Parameter2 > P2_Limit OR _ ' Humidity outside Parameter3 < P3_Limit _ ' Temperature inside the house THEN PRINT "Emergency! Evacuate!" _ ELSE PRINT "Lucky escape today" ' All above (except comments) "builds" to one line Allowing descriptive (or other!) comments after a partial statement, rather than line wrap, which (based on the exact implementation) might look like... IF Parameter1 > P1_Limit AND Parameter2 > P2_Limit OR Parameter3 < P3_Limit THEN PRINT "Emergency! Evacuate!" ELSE PRINT "Lucky escape tod ay" ' Temperature of the freezer, Humidity outside, Temperature insi de the house ' "P3_Limit" is a variable and moved wholly to next line ' "Today" is quoted text and the split just happens at max line length ' "inside" is a comment and split like quoted text For IF statements I've been able to make my code look nicer by nesting... IF Parameter1 > P1_Limit THEN ' Temperature of the freezer IF Parameter2 > P2_Limit THEN ' Humidity outside PRINT "Minor emergency" ENDIF ENDIF But my real problem comes passing parameters into functions. They can't be nested like IF statements. Cheers, |
||||
Page 2 of 2 |
Print this page |