IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#58275 - 06/16/22 09:12 AM misunderstanding of Translate in PressTalk
SveyHarling Offline
OL Newbie

Registered: 05/13/22
Posts: 13
Good day,

I have this PressTalk

define(&i,integer,0)
&iNbLignesAffichees:=0
translate(.9886,4.55)
For(&i,0,1,&iNbPersonnes-1)
&iLigneDebut:=(&i*41)+23
&iLigneEnCours:=&iLigneDebut
&iNbLignesAffichees:=&iNbLignesAffichees+1
show(trim(@(&i+3,1,99)))
translate(2.75,0)
Repeat()
show(trim(@(&iLigneEnCours,1,99)))
crlf(.1823)
&iNbLignesAffichees:=&iNbLignesAffichees+1
&iLigneEnCours:=&iLigneEnCours+1
if(&iNbLignesAffichees=30)
showpage()
&iNbLignesAffichees:=1
&iLigneEnCours:=&iLigneEnCours-1
endif()
until((trim(@(&iLigneEnCours+1,1,5))='') or &iLigneEnCours=&current.lpp)
translate(-2.75,0)
crlf()
crlf()
Endfor()

The first line of my item is not set to the specified 2.75, the subsequent lines are. What am I doing wrong?

Tx

Yves
[img]https://drive.google.com/file/d/1zqqgiPp8KhYw1LUkiadqTVF8wbb_4wPW/view?usp=sharing[/img]

Top
#58276 - 06/17/22 07:04 AM Re: misunderstanding of Translate in PressTalk [Re: SveyHarling]
MartinS Offline
OL Guru

Registered: 08/06/12
Posts: 142
Loc: Munich
what if you would print some sample text right after the very first translate (line 3)?
Would that text have an indent?

Top
#58277 - 06/17/22 08:43 AM Re: misunderstanding of Translate in PressTalk [Re: SveyHarling]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 681
Loc: Québec, Canada
Try this:

define(&i,integer,0)
&iNbLignesAffichees:=0
translate(.9886,4.55)

For(&i,0,1,&iNbPersonnes-1)
&iLigneDebut:=(&i*41)+23
&iLigneEnCours:=&iLigneDebut
&iNbLignesAffichees:=&iNbLignesAffichees+1
translate(2.75,0)
show(trim(@(&i+3,1,99)))


Repeat()
show(trim(@(&iLigneEnCours,1,99)))
crlf(.1823)
&iNbLignesAffichees:=&iNbLignesAffichees+1
&iLigneEnCours:=&iLigneEnCours+1
if(&iNbLignesAffichees=30)
showpage()
&iNbLignesAffichees:=1
&iLigneEnCours:=&iLigneEnCours-1
endif()
until((trim(@(&iLigneEnCours+1,1,5))='') or &iLigneEnCours=&current.lpp)

translate(-2.75,0)
crlf()
crlf()
Endfor()
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top
#58278 - 06/17/22 08:56 AM Re: misunderstanding of Translate in PressTalk [Re: MartinS]
SveyHarling Offline
OL Newbie

Registered: 05/13/22
Posts: 13
Tx for your suggestion Martin.

I have tried it and no the text does not have an indent.

Yves


Edited by SveyHarling (06/17/22 08:59 AM)

Top
#58279 - 06/17/22 09:03 AM Re: misunderstanding of Translate in PressTalk [Re: SveyHarling]
SveyHarling Offline
OL Newbie

Registered: 05/13/22
Posts: 13
Tx for your suggestion Jean-Cedric,

If I try

translate(2.75,0)
show(trim(@(&i+3,1,99)))

The name showing is at 2.75 inches, not a .9886.

[img]https://drive.google.com/file/d/1CAAZ2n-Xi-L8V_7rXfwZORx-K2PJNZrl/view?usp=sharing[/img]

Top
#58280 - 06/17/22 09:10 AM Re: misunderstanding of Translate in PressTalk [Re: SveyHarling]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 681
Loc: Québec, Canada
Sent you a private message
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top
#58281 - 06/17/22 09:54 AM Re: misunderstanding of Translate in PressTalk [Re: SveyHarling]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 681
Loc: Québec, Canada
Can't tell you why this is happening and if you really need to know then I suggest you open a technical support ticket via our website but I did found you a fix.

Before your translate(2.75,0), add a crlf(0) and that's it!
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top
#58282 - 06/17/22 10:43 AM Re: misunderstanding of Translate in PressTalk [Re: SveyHarling]
SveyHarling Offline
OL Newbie

Registered: 05/13/22
Posts: 13
Tx Jean-Cedric. Your solution works perfeclty.

I don't need to know why, ignorance is blessed.

Thank you for helping move my presstalk forward.

Top