Picture Field String -@K

Hello

I have a little problem for the formatting of a string (10)
for numeric fields everything works @P
I took the example in the clarion 11 help
@K(###)@@@-##@##K 305abc4555 (305)abc-45@55

in my test the result gives 305abs4555
my final result is: 305/abs/4555

Thanks

I think your post was modified by Markdown formatting so you lost Backslashes because they were used to escape the next MD char?

If you use the </> on the toolbar to wrap code it will preserve the backslashes, quotes, etc. E.g. I think you are using the @K example that has “-## Backslash + @ Sign ##K” which as </> code:

Not Code: ENTRY(@K(###)@@@-##@##K)
</> Code: ENTRY(@K(###)@@@-##\@##K) see the \

I don’t understand your question. Is it that you typed 305abs4555 into the ENTRY and your String contained 305/abs/4555 but you were expecting (305)abs-45@55 like seen in the help?

Maybe post it again using Code formatting and be sure all characters appear.

I tested your @K and it worked for me in 11.13505. I typed 305abs4555 the USE() String = (305)abs-45@55

There is a bug the Designer errored on the "##\@##" as invalid trying to edit the window, I had to remove the \@ But it compiled fine and that Picture with \@ can be entered into the Designer Picture.

image

image

Hello
H
My problem is simple
I have an entry containing alphanumeric fields
I would like to display it according to a given picture
ex A string(6)
Entry A entered with DAY789
I want to have a display (list;report…) -> DAY/789
the picture @K^^^/###K -> Blank
the picture @K^^^-###K -> Blank

When the field contains numeric everything works fine using the picture @P###/###P
ex entry 123456 result ok 123/456

The @K picture cannot do what you want. You have to have a local variable, some code to format with a “/”, then show that on the report as a STRING(7)

DayNo STRING(6)
DayFmt STRING(7)

   DayNo='DAY123'
   DayFmt=Sub(DayNo,1,3) &'/'& Sub(DayNo,4,3)

The bellow you can ignore but it’s useful for those reading about @k pictures

I think you want your ENTRY to use @P###/###P because you want to feed it a 6 digit number and have the USE variable get that 6 digit number 123456 without the “/” ?

The @K is designed for Strings and the USE variable will contain all the formatting characters. Your example has a String (6) but would need 7 to hold ‘123/456’. …

Or maybe I misunderstood, that you want ‘DAY/123’, so you need a string of 7 bytes because all the @K formatting is stored.

http://clarion.help/doku.php?id=key_in_template_pictures.htm&s[]=pictures&s[]=key

Key-in pictures are used specifically with STRING, PSTRING, and CSTRING fields to allow custom field editing control and validation. Using a key-in picture containing any of the alphabet indicators ( @ ^ _ ) on a numeric entry field produces unpredictable results.

Hello
My field in the table is a string(6)
I only want to display this field as xxx/xxx

ex Field TAB:Name=‘A24789’
in my report I want to display this field as A24/789

I have 200 procedures to modify to handle this context
which complicates my problem

I have a solution from a function that returns the desired value
Ex MyFunc(String Value) ,String
Value=‘A24789’
which returns Sub(Value,1,3)&’/’&Sub(Value,4,3)

I tested the @k examples from help c11.1 13788
I don’t have the desired result
example
Field LOC:A = ’ 10AUG59’
Picture display @K<;# ^^^ ##K
Résult = ‘10AUG59’ search result-> 10 AUG 59

Thank you for your availability

Why dont you export the app file(s) to a TXA, search and replace and then reimport the TXA file(s)?
It could all be done in about 5-10mins.

I would add a field to the file (e.g. TAB:NameFmt) with the XXX/### Formatted version so there is never a need for format code else where. Of course the Form must also store it formatted, and you’ll have to convert the file.

As noted the mass changes to code can be done with a TXA round trip. You will have to find STRING(@s6),...,USE(TAB:Name) and change to (@s7) ... USE(TAB:NameFmt). You’ll need an Editor with Replace that supports Wildcards or RegEx.

LIST is trickery with FORMAT(.... @s6@....) and #FIELDS(...,TAB:Name,...) not being near to each other. Those are probably best done manually in the APP. The column width may need +4 DLUs and maybe other columns adjusted.

The @K picture is NOT designed for what you want, give up on @K