3

I have to stamp to video a simple string, with label and field's values.

I have this code:

 info (strFmt (" @SYS334481: %1 , @SYS4569: %2 " , myTable.AliasUser, myTable.Day) );

I have an output looklike this :

Alias user , Day

I haven't the field's values. I also tried to use this way , but I have a syntax error:

info (strFmt (" "@SYS334481": %1 , "@SYS4569": %2 " , myTable.AliasUser, myTable.Day ));

What is the correct way?

Mark
  • 2,380
  • 11
  • 29
  • 49
ulisses
  • 1,549
  • 3
  • 37
  • 85

2 Answers2

4

While making a specific label will work, I would prefer the simpler:

info(strFmt('%1: %2, %3: %4', fieldPname(myTable,AliasUser), myTable.AliasUser, fieldPname(myTable,Day), myTable.Day));

I often use this technique with setPrefix instead:

setPrefix(strFmt('%1: %2, %3: %4', fieldPname(myTable,AliasUser), myTable.AliasUser, fieldPname(myTable,Day), myTable.Day));
info("More specific message here");

If only one field use the PrefixField macro:

setPrefix(#PrefixField(myTable,AliasUser));
info("More specific message here");

or the PrefixFieldValue sister:

setPrefix(#PrefixField(myTable, AliasUser, myTable.AliasUser+':'));
info("More specific message here");
Community
  • 1
  • 1
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
3

I found a possible solution, It's to creat a new label with %n inside.

I create a label looklike :

@xx00000 = "Alias User: %1 - Day: %2"

I used this syntax:

info (strFmt ("@xx00000" , myTable.AliasUser, myTable.Day) );

I don't know if It's the better solution but It works so well.

If do you have any other solution, write well, will be more information, thanks this community.

enjoy!

ulisses
  • 1,549
  • 3
  • 37
  • 85