PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example: Adding a file into a binary memo
  • Example: Adding an image into a memo
HLinkMemo (Example)
Example: Adding a file into a binary memo
WINDEVUser code (UMC)HFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses) The following example is used to add any file into a "binary memo" item of a data file.
// Fill the different items of the file ...
 
// Was a file name specified for the description of the product?
IF NOT EDT_FILE_NAME ~= "" THEN
// Checks whether this file exists
IF fFileExist(EDT_FILE_NAME) = False THEN
Error("Cannot add " + ...
"the product description file " + ...
"to the database: ", HErrorInfo())
RETURN // or RESULT False
END
 
// Add the file that contains the product description
// in the binary memo item of the record
IF HLinkMemo(PRODUCT,PRODUCTDESCRIPTION, EDT_FILE_NAME, ...
hMemoBin,"File description") = False THEN
Error("Cannot add " + ...
"the product description file " + ...
"to the database: ", HErrorInfo())
RETURN //or RESULT False
END
END
 
// Adds (or modifies) the product to the file of products
IF HAdd(PRODUCT) = False THEN // or IF HModify(PRODUCT) = False THEN
Error("Unable to update the product file:", ...
HErrorInfo())
RETURN //or RESULT False
END
 
RESULT True
Example: Adding an image into a memo
WINDEVUser code (UMC)HFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses) The following example is a procedure used to add a product into the PRODUCT file. This procedure is used to attach the image of each product in the memo of the record.
// Procedure used to add a product
FUNCTION bAddProduct(sProductName, sImage)

// Name of product
PRODUCT.NAME = sProductName

// Photo of product
IF HLinkMemo(PRODUCT,PHOTO, sImage, hMemoImg) = False THEN
RESULT False
END

// Adds the product to the product file
IF HAdd(PRODUCT) = False THEN
RESULT False
END

RESULT True
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment