chodix
6th December 2005, 16:49
Hi,
I have a problem.
domain tdilc.loca has right alignment. In tables, standard sessions everything is ok. but if i am using scipt to update/insert there is no (or left) alignment for this domain.
normal result is loca = " 1234"
but from script:
domain tdilc.loca loca fixed
loca = "1234"
result is loca = "1234 "
did You know what is going on? we checked domains, VRC. We have SP15.
regards,
chodi
vahdani
6th December 2005, 19:30
Hi chodi,
use the function tt.align.according.domain:
domain tdilc.loca loca fixed
long ret
#include <bic_tt>
loca = "1234" |result is loca = "1234 "
ret = tt.align.according.domain(loca, loca, "tdilc.loca")
| now the alignment should be ok!
chodix
6th December 2005, 19:46
vahdani,
thanks for quick replay. in that situation i have one more question. i found that solution before writing that post but i wasn't sure if it is standard solution.
in that case i understand that if we define variable according to domain definition in cases like right alignment we have to use always tt.align.according.domain() function. is it not working automatically without such function? Question is because I don't remember problems with alignment, but maybe right alignment is not to popular;)
Anyway thanks again.
chodi
Hitesh Shah
11th December 2005, 18:00
in that case i understand that if we define variable according to domain definition in cases like right alignment we have to use always tt.align.according.domain() function. is it not working automatically without such function?
chodi
Domain alignments are done automatically whenever standard programs acts with domain (field entry , field validation , field printing ) etc . That's where field sections like before checks come into play.
But in DML programming constructs it's programmers duty c that assignment statements are either proper or certain string manipulation is done to get the desired domain aligned results .
toolswizard
13th December 2005, 14:05
Programmers have to remember 3 things when changing values of variables, especially when changing table values in maintain sessions.
1. The standard program automatically aligns to domain any field entered into the form. The programmer must do this manually if the values is assigned within the code.
2. The standard program automatically rounds numeric fields to the domain any field entered into the form. The programmer must do this manually if the values are assigned within the code.
3. When changing the value of a table field within a maintenance field, you must set the update.status flag by calling the function update.occ. This will signal the standard program that there was a change, otherwise the program will skip the built-in db.update function.