Armando_Rod2000
7th October 2002, 23:09
Hi!!!

How i can to set a string field with bold font?

I have a query on tiitm001 (items)
if the query is selectempty, i want to show a message in my form but i want it with bold font. is that possible? How i can do it?
this is my code:
select tiitm001.*
from tiitm001
where tiitm001._index1 = {:MY_ITEM}
selectdo
display ("tiitm001.dsca")
selectempty
tiitm001.dsca = MY_MESSAGE (but i want it with bold text )
display ("tiitm001.dsca")
endselect

baanprog
7th October 2002, 23:23
Do u want to show this as a message and press ok or you wannu show it on the form with a variable???

Armando_Rod2000
7th October 2002, 23:38
i want to show it in the form :cool:

NPRao
7th October 2002, 23:41
Armando,

Please use the search option on the Board.

Here's a thread to that topic -

Bold a form display field? (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1825&highlight=bold)

baanprog
7th October 2002, 23:58
If u dont want to use bshell functions

declare two variables, and make of them bold on from the other normal.

in the selectdo make the bold variable empty and display.In the selectempty make the normal variable empty.

this will work

cheers

Armando_Rod2000
8th October 2002, 00:24
That's an excelent example !!!!!!!!!!!!!!

Armando_Rod2000
8th October 2002, 00:42
i'm trying with the documentation that you give me but that don“t show bold text on the form.
why? what am i doing bad?
my code:

tdimpo103.11 ==> Data mess ('Item not found')


extern domain tcmcs.str20 mess.form

select tiitm001.*
from tiitm001
where tiitm001._index1 = {:MY_ITEM}
selectdo
display ("tiitm001.dsca")
selectempty
mess.form = toupper$(form.text$("tdimpo103.11"))
print cf$(8),mess.form,cf$(0)
endselect

NPRao
8th October 2002, 02:01
Armando,

Please check your code. I guess you might have made a mistake -

print cf$(8),mess.form,cf$(0)

It should be -

spool.pr.line = cf$(1) &"Printed Bold" & cf$(0)

You need to use the screen codes and append the string to be displayed between the tags of start bold and end bold/normal mode.

The screen code 8 is for underscore underscore mode.

mark_h
8th October 2002, 03:14
Armando,

As Ed says in the other post he has not seen bold work on the GUI. So I am not sure that you are doing anything wrong. You may want to try the cf$(4).

And NPR says:
It should be -

spool.pr.line = cf$(1) &"Printed Bold" & cf$(0)

Why spool.pr.line? Isn't this only for reports? Armando says that he is doing this on a form so I believe print is correct in this case.


Mark

PS I deleted the duplicate post by Armando.

NPRao
8th October 2002, 03:26
Sorry for the confusion Mark,

I was using the example from the other posting -


Example

| To screen
print cf$(4),"This is reversed printing on the screen",cf$(0)

| To printer
spool.pr.line = cf$(4)&"Printed reverse"&cf$(0)

spool.line()


I just tested it works in reports, I couldnt get it working for the form fields. :(

Maybe dbinderbr, needs to post a sample code for GUI. I used ASCII and BaaN-4 long back in 1997.

Hitesh Shah
8th October 2002, 12:09
U may use pre-defined variable attr.cf (R/W) in before.display of the field. U may set the values from 0 to 15 and see the results.

I had tested this long back .

RobertB
8th October 2002, 18:28
Hi Armando,

I couldn't even get the bold to work in the GUI (Vc), let alone reverse!!

So, true to form ;), I played around with some Baan Objects, and came up with a form-label that has configurable positioning, font, font-size, font-bolding and font-italics (but, strangely, not color :( ). I used this in a Print session form, but I guess it could go on any form (?).

You have to play around with the positioning a little, and make sure you have room on the form for the label. See the attached file for details...

HTH,
Robert

Armando_Rod2000
14th October 2002, 01:01
If Hitesh Shah have some code please post a reply. I only want to find a solution about this crazy case.

Hitesh Shah
14th October 2002, 09:25
RobertB's remarks are correct .

Attr.cf tested by me was for Reverse . If attention catiching is the issue you can use attr.cf = 4 in before display of the form field which will give reverse font.

All other code features like underline , bold blinking etc are not working in GUI (BW). It works only in ASCII interwace (BA).

If u need only bold font and that too in GUI , you may contact BGS.

However as far as i know , they also may not be able to do anything because of the way BW interface works.

fmartinezber
24th June 2003, 19:03
Hi, It's long time ago.

But I've been trying to remark special lines in a multiline form using "attr.cf = 4" in the before.display and others. Nothing goes ahead.

Do you have any idea?, my userkey wants to see differences between lines.

Regards.

NvanBeest
25th June 2003, 01:11
Maybe an easy solution for the problem. :p

If you have a spare line on your form (just below the item description field), add a new string field there with the bold attribute set during the form design. Then, in the select part of the query, clear the field's value, and in the selectempty part, set this field's value to the message.

Hitesh Shah
25th June 2003, 09:16
It has worked very nicely for me .

I can see following reasons why it may not be working at ur end.

1. The code attr.cf = 4 may not be executed at all . Meaning the condition on which this may be executed may not be satisifed at all. Beware of string comparisons with table fields with trailing spaces. Table fields return fixed number of strings.

2. The code written in before.display will get executed only for display field. The field in ur case may be input .

Ilansu
25th June 2003, 13:08
Hi
see the attached file to use the attr.cf

Ilan S

fmartinezber
25th June 2003, 17:20
It doesn't run, I think the reason is de BaaN version. I have BaaN ERP, and attributes that appear in the word document aren't in my field window (form editor).

thanks.

Do you have any other idea?,

I haven't got extra fields or lines, I have a multine window, and I don't know how to set "bold" in design time.

Hitesh Shah
26th June 2003, 08:48
I think u r right. It may be the version difference .

But BaanERP windows interface is superior to Baan IV . I am sure somebody on BaanERP can help u out very easily in accomplishing ur objective.

spartacus
16th September 2003, 11:05
Tried to find attr.cf in the tools help for BaanERP. Couldn't find it. Maybe this variable doesn't work for ERP?

(I put it into the code. The compiler works without error, but it doesn't work!)

NPRao
16th September 2003, 18:56
Spartacus,

All the functions listed under - Character-based windows - overview and synopsis (http://www.baanboard.com/programmers_manual_baanerp_help_functions_char_b_win_overview_and_synopsis) are valid only for the BaaN-4 series on the Unix terminals and not for BW/Worktop/Webtop Interfaces.

spartacus
17th September 2003, 10:03
So Baan didn't do a good job, to describe the "Character-based windows" functions in BaanERP, or? Is a little bit confusing?

NPRao
17th September 2003, 20:11
Spartacus,

When its specified - Character-based windows it means that they are valid for the BA interface.

Hence, I think BaaN is clear in this instance so you cant say they didnt do good job. I guess you might be confused with the terminology. Although there are instances when the documentation is not always perfect with the latest changes in the tools.

spartacus
18th September 2003, 09:36
I thought threre is no BA inferface anymore for ERP? So I took a look in $BSE/bin and found.... a ba6.2 !! So I tried from ksh to start but get an error.

Think I have to read the docu, what ba6.2 realy does!!

lbencic
18th September 2003, 16:48
No ascii interface...that's the pitch, yet General Table Maintenance, and I think some tools / validation sessions still come up ascii. Maybe ba6.2 is there for running those sessions.

NPRao
18th September 2003, 21:25
Lisa,

GTM does not use the ba6.2 interface. It uses the old fashioned Character Based Windows functions (similar to the old Unix-C style - Cursors, Panel, Menu.h header files & functions)

Here is a example-

function main()
{
long main.win
string description(320), title(80)

description = "Testing"
title = prog.name$
main.win = new.window(23, 80, 1, 1)
print fg$(CW.CYAN)
box(1, 2, 80, 3, 0)
print fg$(CW.WHITE)
cl.screen(2, 3, 78, 1)
mb.display(description, title, 76)
print cp$(4, 3), cf$(1), title, cf$(0)
cl.screen(2, 5, 78, 18)
refresh()
suspend(3000)
}

Credits to Nico, I came across that one from his tip.