1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 11:40:38 +00:00
QB64-PE/internal/help/LPOS.txt
SteveMcNeill 33adc04fc4 Add temp folder to repo. It's necessary as well!
Just more initial setting on... nothing much to see here.
2022-04-28 13:39:56 -04:00

48 lines
1.5 KiB
Plaintext

The [[LPOS]] function returns the current LPT printer head position.
{{PageSyntax}}
: {{Parameter|result%}} = [[LPOS]]({{Parameter|index%}})
{{PageDescription}}
* {{Parameter|index%}} is the index of the printer, which can have the following values:
** 0 - LPT1:
** 1 - LPT1:
** 2 - LPT2:
** 3 - LPT3:
* The LPOS function does not necessarily give the physical position of the print head because it does not expand tab characters. In addition, some printers may buffer characters.
{{PageExamples}}
:Prompts the user for team names and the names of players on each team. It then prints the players and their teams on the printer.
{{CodeStart}}{{Cl|CLS}}
{{Cl|LPRINT}} "Team Members"; {{Cl|TAB}}(76); "TEAM" : {{Cl|LPRINT}}
{{Cl|INPUT}} "How many teams"; TEAMS
{{Cl|INPUT}} "How many players per team";PPT
{{Cl|PRINT}}
{{Cl|FOR}} T = 1 TO TEAMS
{{Cl|INPUT}} "Team name: ", TEAM$
{{Cl|FOR}} P = 1 TO PPT
{{Cl|INPUT}} " Enter player name: ", PLAYER$
{{Cl|LPRINT}} PLAYER$;
{{Cl|IF...THEN|IF}} P < PPT {{Cl|THEN}}
{{Cl|IF...THEN|IF}} {{Cl|LPOS}}(0) > 55 {{Cl|THEN}} ' Print a new line if print head past column 55.
{{Cl|LPRINT}} : {{Cl|LPRINT}} {{Cl|SPACE$}}(5);
{{Cl|ELSE}}
{{Cl|LPRINT}} ", "; 'Otherwise, print a comma.
{{Cl|END}} IF
{{Cl|END}} IF
{{Cl|NEXT}} P
{{Cl|LPRINT}} {{Cl|STRING$}}(80 - {{Cl|LPOS}}(0) - {{Cl|LEN}}(TEAM$),"."); TEAM$
{{Cl|NEXT}} T
{{CodeEnd}}
{{PageSeeAlso}}
* [[LPRINT]]
{{PageNavigation}}
<