For Programmers: Free Programming Magazines  


Home > Archive > Clarion > July 2004 > Hyperlink to Text Field Values









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Hyperlink to Text Field Values
Jain Jacob

2004-07-29, 3:55 am

Hi,

Is it possible to "call a program" based on mouse click in a
particular value in a field.
For Eg:
I am storing the actor's names in a single field for a movie title.
When displaying this movie details as follows
Actors : Arnold,Van Damme,Bruce Willis.
When clicking on "Arnold", another program(Page in web application)to
be opened which lists the movies in which Mr.Arnold has acted. Please
note all the names are stored in a single field with comma seperation.

Please Help

Regards
JAIN
Hilario Perez

2004-07-29, 3:55 pm

you can try using the EVENT:SELECTED event:

myField STRING('Arnold,Van Damme,Bruce Willis')
MyWindow WINDOW('Caption'),AT(,,260,100),GRAY
ENTRY(@s20),AT(30,14,148,10),USE(myField
),FONT(,,COLOR:Blue,FONT:underline,CHARS
ET:ANSI),CURSOR(CURSOR:UpArrow)
BUTTON('Close'),AT(159,60,45,14),USE(?Close),STD(STD:Close)
END

CODE
OPEN(MyWindow)
ACCEPT
CASE FIELD()
OF ?MyField
IF EVENT() = EVENT:SELECTED THEN
CASE ?MyField{PROP:SELSTART}
OF 1 TO 7
!ShellExecute for Arnold
OF 8 TO 17
!ShellExecute for Van Damme
OF 18 TO 30
!ShellExecute for Bruce Willis
END
END
END
END

jainjacob@cochincomputers.com (Jain Jacob) wrote in message news:<775d8658.0407282049.7809b970@posting.google.com>...
> Hi,
>
> Is it possible to "call a program" based on mouse click in a
> particular value in a field.
> For Eg:
> I am storing the actor's names in a single field for a movie title.
> When displaying this movie details as follows
> Actors : Arnold,Van Damme,Bruce Willis.
> When clicking on "Arnold", another program(Page in web application)to
> be opened which lists the movies in which Mr.Arnold has acted. Please
> note all the names are stored in a single field with comma seperation.
>
> Please Help
>
> Regards
> JAIN

Jain Jacob

2004-07-30, 3:55 am

Thanks for the solution.The length will not be a constant.That may
vary from record to record.That may be solved by finding the position
of comma and so on, Is it possible to provide a hyperlink and "hand
pointer" like interface and that also in a two dimensional
presentation style(just like prompts) instead of a three dimensional
field(For Eg :address filed in your browser).The context is a web
page to be developed in Clarion6 not a clarion program.



hilario@sistemasfw.com (Hilario Perez) wrote in message news:<e7fd3193.0407290944.74ceca0a@posting.google.com>...[color=darkred]
> you can try using the EVENT:SELECTED event:
>
> myField STRING('Arnold,Van Damme,Bruce Willis')
> MyWindow WINDOW('Caption'),AT(,,260,100),GRAY
> ENTRY(@s20),AT(30,14,148,10),USE(myField
),FONT(,,COLOR:Blue,FONT:underline,CHARS
ET:ANSI),CURSOR(CURSOR:UpArrow)
> BUTTON('Close'),AT(159,60,45,14),USE(?Close),STD(STD:Close)
> END
>
> CODE
> OPEN(MyWindow)
> ACCEPT
> CASE FIELD()
> OF ?MyField
> IF EVENT() = EVENT:SELECTED THEN
> CASE ?MyField{PROP:SELSTART}
> OF 1 TO 7
> !ShellExecute for Arnold
> OF 8 TO 17
> !ShellExecute for Van Damme
> OF 18 TO 30
> !ShellExecute for Bruce Willis
> END
> END
> END
> END
>
> jainjacob@cochincomputers.com (Jain Jacob) wrote in message news:<775d8658.0407282049.7809b970@posting.google.com>...
Hilario Perez

2004-07-30, 8:55 pm

Use a Queue:


myQueue QUEUE,PRE(Mq)
Name STRING(20) !Actor Name
Link CSTRING(251) !Internet URL
END
myField STRING(250)
MyWindow WINDOW('Caption'),AT(,,260,100),GRAY
ENTRY(@s20),AT(30,14,148,10),USE(myField
),FONT(,,COLOR:Blue,FONT:underline,CHARS
ET:ANSI),CURSOR(CURSOR:UpArrow),TRN,READ
ONLY
BUTTON('Close'),AT(159,60,45,14),USE(?Close),STD(STD:Close)
END

CODE
OPEN(MyWindow)
ACCEPT
IF EVENT() = EVENT:OPENWINDOW THEN
!
! Load the Queue with actors. You can do a loop throught a
file
! maybe, like:
!
! FREE(myQueue)
! SET(ACTORS)
! LOOP
! IF ACCESS:ACTORS.NEXT() THEN BREAK.
! Mq:Name = ACT:Name
! Mq:Link = 'http://www.actors.com/showmovies.asp?actor='
& ACT:Name
! ADD(myQueue)
! END
! DO LoadMyField
!
FREE(myQueue)
Mq:Name = 'Arnold'; Mq:Link = 'http://www.arnold.com';
ADD(myQueue)
Mq:Name = 'Van Damme'; Mq:Link = 'http://www.vandamme.com';
ADD(myQueue)
Mq:Name = 'Bruce Willis'; Mq:Link =
'http://www.brucewillis.com';
ADD(myQueue)
DO LoadMyField
END
CASE FIELD()
OF ?MyField
IF EVENT() = EVENT:SELECTED THEN
LOOP REC# = 1 TO RECORDS(myQueue)
GET(myQueue,Rec#)
Pos# = INSTRING(CLIP(Mq:Name),MyField,1,1)
IF Pos# < 1 THEN CYCLE.
IF INRANGE(? MyField{PROP:SELSTART},Pos#,Pos#+LEN(CLI
P(Mq:Name)))
!Call ShelExecute, using Mq:Link as the URL
END
END
END
END
END

LoadMyField ROUTINE
MyField = ''
IF RECORDS(myQueue) THEN
GET(myQueue,1)
MyField = CLIP(Mq:Name)
LOOP REC# = 2 TO RECORDS(myQueue)
GET(myQueue,REC#)
myField = CLIP(myField) & ',' & CLIP(Mq:Name)
END
END
DISPLAY

jainjacob@cochincomputers.com (Jain Jacob) wrote in message news:<775d8658.0407292038.30e67e55@posting.google.com>...[color=darkred]
> Thanks for the solution.The length will not be a constant.That may
> vary from record to record.That may be solved by finding the position
> of comma and so on, Is it possible to provide a hyperlink and "hand
> pointer" like interface and that also in a two dimensional
> presentation style(just like prompts) instead of a three dimensional
> field(For Eg :address filed in your browser).The context is a web
> page to be developed in Clarion6 not a clarion program.
>
>
>
> hilario@sistemasfw.com (Hilario Perez) wrote in message news:<e7fd3193.0407290944.74ceca0a@posting.google.com>...
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com