Dear Sir,
I wish to attach a script to a button to import a bitmap or jpeg into a field in a table. I am aware that I can right hand click on the field on the form to accomplish the same task, but I want a more profession approach. Please note that I do not want to use the �image file Reference fields� function.
The table is called "Test" and this is its simple structure of my table:
Name Character 10
Date Date 8
Image JpegImage 10
I would be most grateful if you could tell me how the script should be written. Please amend my attempt?
This my attempt at writing a script to accomplish this task:
'Date Created: 31-Dec-2002 03:46:51 PM
'Last Updated: 22-Jan-2003 08:15:50 PM
'Created By:
'Updated By:
' ask the user for a new image,
' and display it in the object
' Create variable for the current and new images names.
DIM CurrentName AS C
DIM NewName AS C
' Get the file name of the bitmap currently display in the form.
' ImageDisplay is the name assigned to the image.
CurrentName = OBJ_GET( "Image", "ImageImport" )
' Display a file open dialog box and ask for the image.
IF CurrentName = ""
' No bitmap has been displayed.
NewName = UI_GET_FILE( "Select a image", "*.jpeg" )
ELSE
' A image is already displayed.
' Use the current image as the default file.
NewName = UI_GET_FILE( "Replace Current Image","*.jpeg", CurrentName )
END IF
' If the user selected a new image file.
IF NewName ""
' Display the new file name in the image object.
OBJ_PUT( "Image", "ImageImport", NewName )
' Redraw the form.
CARD_PAINT()
END IF
Could I suggest to technical support this is one operation were a genie would be very useful.
Regards
Mark
I wish to attach a script to a button to import a bitmap or jpeg into a field in a table. I am aware that I can right hand click on the field on the form to accomplish the same task, but I want a more profession approach. Please note that I do not want to use the �image file Reference fields� function.
The table is called "Test" and this is its simple structure of my table:
Name Character 10
Date Date 8
Image JpegImage 10
I would be most grateful if you could tell me how the script should be written. Please amend my attempt?
This my attempt at writing a script to accomplish this task:
'Date Created: 31-Dec-2002 03:46:51 PM
'Last Updated: 22-Jan-2003 08:15:50 PM
'Created By:
'Updated By:
' ask the user for a new image,
' and display it in the object
' Create variable for the current and new images names.
DIM CurrentName AS C
DIM NewName AS C
' Get the file name of the bitmap currently display in the form.
' ImageDisplay is the name assigned to the image.
CurrentName = OBJ_GET( "Image", "ImageImport" )
' Display a file open dialog box and ask for the image.
IF CurrentName = ""
' No bitmap has been displayed.
NewName = UI_GET_FILE( "Select a image", "*.jpeg" )
ELSE
' A image is already displayed.
' Use the current image as the default file.
NewName = UI_GET_FILE( "Replace Current Image","*.jpeg", CurrentName )
END IF
' If the user selected a new image file.
IF NewName ""
' Display the new file name in the image object.
OBJ_PUT( "Image", "ImageImport", NewName )
' Redraw the form.
CARD_PAINT()
END IF
Could I suggest to technical support this is one operation were a genie would be very useful.
Regards
Mark