PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Canceling the existing association
  • Differences between BinaryLoad and HLinkMemo
  • HLinkMemo and remote access (RPC)
  • HFSQL thumbnails
  • Managing memos in SQLite
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HLinkMemo (Function)
In French: HAttacheMémo
ODBCNot available with this kind of connection
Used to associate a file with a binary memo item or to cancel the existing link between a file and a binary item.
The file will be read and added into the memo only when adding or modifying the record (HAdd, HModify or HWrite). The function will return an error if the file is opened in write mode and if the hAcceptOpenedFile constant was not used.
HExtractMemo will be used to extract the file contained in the memo onto the hard disk.
Note: You also have the ability to use the direct assignment:
  • To associate an image (found in an Image control) with an image memo:
    <FileName>.<NameMemoItem> = <NameImageControl>

    For example:
    AFile.AMemoItem = IMG_AnImageControl

    This syntax can be used with the HFSQL engine and with the Native Accesses.
    <FileName>.<NameMemoItem> = <BufferName>

    For example:
    bufFile is Buffer = fLoadBuffer("MyFile")
    MyFile.MyMemo = bufFile
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
// Attaches an image to the record
HLinkMemo(Product, Product_Image, "C:\Images\Product1.gif", hMemoImg)
// Transfers the content of controls into the file buffer
ScreenToFile()
// Adds the record
HAdd(Product)
Syntax

Associating a file with a binary memo item Hide the details

<Result> = HLinkMemo(<File Name> , <Item Name> [, <File to Attach> [, <Type> [, <Information>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HError is used to identify the error. The function will return an error if the file to associate is opened in write mode and if the hAcceptOpenedFile constant was not used.
<File Name>: Character string (with or without quotes)
Name of the data file (or query) containing a memo item. If only <File Name> and <Item Name> are specified, HLinkMemo cancels the association found between the binary file and the item.
<Item Name>: Character string (with or without quotes)
Name of the memo item of the data file into which the binary file must be added. If only <File Name> and <Item Name> are specified, HLinkMemo cancels the association found between the binary file and the item.
<File to Attach>: Optional character string
Name of the file that will be associated with the binary memo item. This name can correspond to:
  • the full path of the file to attach,
  • a relative path (respective to the current directory) of the file to attach.
    Windows Mobile No relative path can be used.
If this parameter is not specified or if it corresponds to an empty string (""), the current attachment is deleted.
AndroidAndroid Widget Java If a path is specified, this path must correspond to an existing file. Otherwise, a fatal error is displayed.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
hAcceptOpenedFileAllows you to read the source file that will be added to the memo if this source file is opened in write mode somewhere else.
This constant can be used with the constants for file type.
hMemoBin
(default value)
The file is an ordinary binary file.
hMemoImgThe file is an image file.
hMemoOleThe file is an OLE file.
hMemoWavThe file is a sound file.
AndroidAndroid Widget JavaPHPOLE DBNative Accesses This parameter is ignored.
PHPOLE DBNative Accesses This parameter is ignored.
Versions 20 and later
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
New in version 20
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
<Information>: Optional character string
Information message (up to 65535 characters) stored with the file. This message can be read again by HInfoMemo.
AndroidAndroid Widget JavaPHPOLE DBNative Accesses This parameter is ignored.
PHPOLE DBNative Accesses This parameter is ignored.
Versions 20 and later
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
New in version 20
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
Versions 19 and later
WINDEVWEBDEV - Server codeWindows Mobile

Associating a file with a binary memo item via a Record type variable Hide the details

<Result> = HLinkMemo(<Memo Item> [, <File to Attach> [, <Type> [, <Information>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HError is used to identify the error. The function will return an error if the file to associate is opened in write mode and if the hAcceptOpenedFile constant was not used.
<Memo Item>: Record variable
Memo item where the binary file must be added. Use the following notation: <Name of Record Variable>.<Name of Memo Item>. If only the <Memo Item> parameter is specified, HLinkMemo cancels the existing attachment between the binary file and the item.
<File to Attach>: Optional character string
Name of the file that will be associated with the binary memo item. This name can correspond to:
  • the full path of the file to attach,
  • a relative path (respective to the current directory) of the file to attach.
    Windows Mobile No relative path can be used.
If this parameter is not specified or if it corresponds to an empty string (""), the current attachment is deleted.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
hAcceptOpenedFileAllows you to read the source file that will be added to the memo if this source file is opened in write mode somewhere else.
This constant can be used with the constants for file type.
hMemoBin
(default value)
The file is an ordinary binary file.
hMemoImgThe file is an image file.
hMemoOleThe file is an OLE file.
hMemoWavThe file is a sound file.
<Information>: Optional character string
Information message (up to 65535 characters) stored with the file. This message can be read again by HInfoMemo.
OLE DBNative Accesses This parameter is ignored.
New in version 19
WINDEVWEBDEV - Server codeWindows Mobile

Associating a file with a binary memo item via a Record type variable Hide the details

<Result> = HLinkMemo(<Memo Item> [, <File to Attach> [, <Type> [, <Information>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HError is used to identify the error. The function will return an error if the file to associate is opened in write mode and if the hAcceptOpenedFile constant was not used.
<Memo Item>: Record variable
Memo item where the binary file must be added. Use the following notation: <Name of Record Variable>.<Name of Memo Item>. If only the <Memo Item> parameter is specified, HLinkMemo cancels the existing attachment between the binary file and the item.
<File to Attach>: Optional character string
Name of the file that will be associated with the binary memo item. This name can correspond to:
  • the full path of the file to attach,
  • a relative path (respective to the current directory) of the file to attach.
    Windows Mobile No relative path can be used.
If this parameter is not specified or if it corresponds to an empty string (""), the current attachment is deleted.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
hAcceptOpenedFileAllows you to read the source file that will be added to the memo if this source file is opened in write mode somewhere else.
This constant can be used with the constants for file type.
hMemoBin
(default value)
The file is an ordinary binary file.
hMemoImgThe file is an image file.
hMemoOleThe file is an OLE file.
hMemoWavThe file is a sound file.
<Information>: Optional character string
Information message (up to 65535 characters) stored with the file. This message can be read again by HInfoMemo.
OLE DBNative Accesses This parameter is ignored.
WINDEVWEBDEV - Server codeWindows Mobile

Associating a file with a binary memo item via a Record type variable Hide the details

<Result> = HLinkMemo(<Memo Item> [, <File to Attach> [, <Type> [, <Information>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HError is used to identify the error. The function will return an error if the file to associate is opened in write mode and if the hAcceptOpenedFile constant was not used.
<Memo Item>: Record variable
Memo item where the binary file must be added. Use the following notation: <Name of Record Variable>.<Name of Memo Item>. If only the <Memo Item> parameter is specified, HLinkMemo cancels the existing attachment between the binary file and the item.
<File to Attach>: Optional character string
Name of the file that will be associated with the binary memo item. This name can correspond to:
  • the full path of the file to attach,
  • a relative path (respective to the current directory) of the file to attach.
    Windows Mobile No relative path can be used.
If this parameter is not specified or if it corresponds to an empty string (""), the current attachment is deleted.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
hAcceptOpenedFileAllows you to read the source file that will be added to the memo if this source file is opened in write mode somewhere else.
This constant can be used with the constants for file type.
hMemoBin
(default value)
The file is an ordinary binary file.
hMemoImgThe file is an image file.
hMemoOleThe file is an OLE file.
hMemoWavThe file is a sound file.
<Information>: Optional character string
Information message (up to 65535 characters) stored with the file. This message can be read again by HInfoMemo.
OLE DBNative Accesses This parameter is ignored.
Remarks

Canceling the existing association

If only <File Name> and <Item Name> are specified, HLinkMemo cancels the association found between the binary file and the item.
WINDEVWEBDEV - Server codeReports and QueriesJavaAjaxUser code (UMC)External languageHFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Accesses

Differences between BinaryLoad and HLinkMemo

Unlike BinaryLoad, HLinkMemo does not load the binary file in memory.. Therefore, there is no risk of memory overload when a large file is associated with a binary memo item.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileAjaxUser code (UMC)External languageStored procedures

HLinkMemo and remote access (RPC)

HLinkMemo searches for the file to attach on the RPC server (even if the function is run locally on a remote computer).
To insert into a memo a file found locally and not on the RPC server, the memo item must be assigned with its full content, without calling HLinkMemo.
Example: Insert from a WINDEV Mobile application an image found in the executable directory:
sImage is string
sImage = fExeDir() + "\signature.jpg"
FileBuffer is Buffer
FileBuffer = fLoadText(sImage)
FileOnRPCServer.ImageItem = UnicodeToAnsi(FileBuffer)
HAdd(FileOnRPCServer)
The image is sent to the RPC server during the addition. The RPC server includes it into the memo, whether the connection to the database is established via OLE DB or via native access.
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)External languageHFSQLHFSQL Client/ServerStored procedures

HFSQL thumbnails

If the item is using HFSQL thumbnails, the thumbnails will be automatically generated with the new file when adding or modifying the record (HAdd, HModify or HWrite).
Native Accesses

Managing memos in SQLite

Storing information in memo format is recommended for the data whose size is less than 1 MB. We advise you to directly save the data in external file format on the internal or external memory of the phone and to store the access path to this data in the database.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment