PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example: Extracting the image of a product (syntax 1)
  • Example: Extracting the image of a product (syntax 2)
HExtractMemo (Example)
Example: Extracting the image of a product (syntax 1)
WINDEVWEBDEV - Server codeReports and QueriesWindowsLinuxAjaxUser code (UMC)HFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses)
This example is a procedure used to extract the image of the product associated with the current record.
PROCEDURE bExtractProduct(sProductName)
 
IF HReadSeekFirst(PRODUCT, sProductName) = True THEN
// Photo of product
IF HExtractMemo(SQLGetMemo("MyQuery", 2), "Product.BMP") = False THEN
RESULT False
END
END
RESULT True
Example: Extracting the image of a product (syntax 2)
WINDEVWEBDEV - Server codeReports and QueriesWindowsWindows MobileAjaxUser code (UMC)HFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses)
This example is a procedure used to extract, for the current record, the file associated with the PHOTO memo item.
The file is retrieved with its initial name in the current temporary directory.
PROCEDURE bExtractProduct(sProductName, sFileName is string)
 
IF HReadSeekFirst(PRODUCT, sProductName) = True THEN
// Photo of product
sMemoInfo is string
sMemoInfo = HInfoMemo(PRODUCT, PHOTO)
IF sMemoInfo = "" THEN
RESULT False // no file in the memo
ELSE
// Retrieves the name of the source file of memo (without path)
// with the temporary directory
sFileName is string
sFileName = fTempPath()+["\"] + ...
fExtractPath(ExtractString(sMemoInfo, 2, TAB), ...
  fFileName + fExtension)
 
IF HExtractMemo(PRODUCT, PHOTO, sFileName) = False THEN
RESULT False
END
 
END
END
RESULT True
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment