Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageyou 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,C
HARSET: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.7809b
970@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
Post Follow-up to this messageThanks 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>...
> 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:unde
rline,CHARSET:ANSI),CURSOR(CURSOR:UpArro
w)
> 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>...
Post Follow-up to this messageUse 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,C
HARSET:ANSI),CURSOR(CURSOR:UpArrow),TRN,
READONLY
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.30e67
e55@posting.google.com>...
> 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.040
7290944.74ceca0a@posting.google.com>...
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.