ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • 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 QueriesWindowsLinuxUser code (UMC)AjaxHFSQL ClassicHFSQL 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
// Product image
IF HExtractMemo(SQLGetMemo("MyQuery", 2), "Product.BMP") = False THEN
RESULT False
END
END
RETURN True
Example: Extracting the image of a product (syntax 2)
WINDEVWEBDEV - Server codeReports and QueriesWindowsUser code (UMC)AjaxHFSQL ClassicHFSQL 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
// Product image
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
RETURN True
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help