|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
eric_carwardine
Joined: 13 Jun 2009 Posts: 70 Location: Perth, Western Australia
|
Posted: Sat Mar 09, 2013 11:28 am Post subject: Single quotes in text to be printed |
|
|
G'day, folks
Is it possible to include single quotes (') in text to be printed?
For example:
ia=winio@('Enter will remain greyed until a title is supplied.&')
I'd like to display Enter surrounded by single quotes, thus: 'Enter'
Eric |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Sat Mar 09, 2013 11:49 am Post subject: |
|
|
Try using double quotes for the whole string then a single quote inside.
Code: | ia=winio@("Enter will remain 'greyed' until a title is supplied.&") |
|
|
Back to top |
|
|
eric_carwardine
Joined: 13 Jun 2009 Posts: 70 Location: Perth, Western Australia
|
Posted: Sat Mar 09, 2013 12:42 pm Post subject: |
|
|
Thankyou Paul
Using the double quote as the delimiter solved the problem nicely.
Now I ask myself if such a feat is possible. That is, that 'Enter' remain greyed until text is entered into the edit box. The code so far is as follows. I've created a callback function 'title_cannot_be_blank' but so far the function does nothing.
Code: |
iget_title=1
ia=winio@('%ca[Job Title]%`cn&')
ia=winio@('%nlToday''s date and time are %`rs&', date_time)
ia=winio@('%nlEnter a title for the job.&')
ia=winio@
1 (" 'Enter' will remain greyed until a title is entered.&")
ia=winio@('%nl%70rs&', job)
ia=winio@('%~^bt[Enter]%^bt[No change]',
1 flags(16), title_cannot_be_blank, quitter)
C
if(job .ne. ' ' .and. nsel .gt. 0) flags(17) = 1 ! 'Run'
C
return
end
|
Eric |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Sat Mar 09, 2013 2:24 pm Post subject: |
|
|
Graying usually needs just one small callback function. Demonstrated here on longer example where graying does not allow run the code until title is supplied - if it is what you were asking for. I used free format because this forum adds one more space to the beginning of the line making fixed format text non-compilable as is. And then bored to declare integer/external functions and common blocks i used modules, sorry if this is not your style. You can put all that into external functions.
Compile> FTN95 TEST.for /free /link /debug or call it TEST.F95 and then /free is not needed
Code: | module AllFunct
use clrwin
character*64 date_time, job
integer flags(17)
contains
integer function title_cannot_be_blank()
if(job.ne.' ') flags(16)=1
call window_update@(flags(16))
title_cannot_be_blank=1
end function
integer function Run()
parameter (N=10)
real*8 X(N),Y(N)
iwid =400; iheig=250
do i=1,N
x(i)=i-1
y(i)=x(i)**2
enddo
i=winio@('%ww%pv%pl[x_array]&', iwid, iheig, N, x, y)
i=winio@('%ac[esc]','exit')
Run=1
end function
integer function quitter()
quitter=1
end function
end module
!.....................................................
program TEST
use AllFunct
flags(16) = 0
job=' '
ia=winio@('%ca[Job Title]%`cn&')
ia=winio@('%ac[esc]&','exit')
ia=winio@('%nlToday''s date and time are %`rs&', date_time)
ia=winio@('%nlEnter a title for the job.&')
ia=winio@(" 'Enter' will remain greyed until a title is entered.&")
ia=winio@('%nl%40^rs&', job,title_cannot_be_blank)
ia=winio@('%~^bt[Enter]%^bt[No change]',flags(16), Run, quitter)
!
if(job .ne. ' ' .and. nsel .gt. 0) flags(17) = 1 ! 'Run'
!
end |
Last edited by DanRRight on Sun Mar 10, 2013 12:56 pm; edited 2 times in total |
|
Back to top |
|
|
eric_carwardine
Joined: 13 Jun 2009 Posts: 70 Location: Perth, Western Australia
|
Posted: Sat Mar 09, 2013 4:56 pm Post subject: |
|
|
Thankyou, Dan
The first interesting feature I noticed was the callback function in association with rs in the code line
Code: |
ia=winio@('%nl%40^rs&', job,title_cannot_be_blank)
|
So that 'title_cannot_be_blank' is used to monitor changes in the edit box. Most clever!
Thanks again, Dan
Eric |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|