S sorex Expert Licensed User Longtime User Dec 9, 2018 #1 Hello, I notice that I still need to use OS depending code exeptions while using Code: Copy xui.FileUri(file.dirAssets,"") the reason is that the B4A result has a trailing slash but B4i doesn't. Can this be normalized so that both results are the same (both with or without trailing slash)? Last edited: Dec 9, 2018
Hello, I notice that I still need to use OS depending code exeptions while using Code: Copy xui.FileUri(file.dirAssets,"") the reason is that the B4A result has a trailing slash but B4i doesn't. Can this be normalized so that both results are the same (both with or without trailing slash)?
Erel B4X founder Staff member Licensed User Longtime User Dec 10, 2018 #2 Please post an example where this code fails.
S sorex Expert Licensed User Longtime User Dec 10, 2018 #3 I'm using a webview based "how to play" screen with local images. The current code to update the html with the right path is this... Code: Copy #if B4A html=html.Replace("[path]",xui.FileUri(dirAssets,"") ) 'has trailing / #else html=html.Replace("[path]",xui.FileUri(dirAssets,"") & "/") 'add trailing / #end if Last edited: Dec 10, 2018
I'm using a webview based "how to play" screen with local images. The current code to update the html with the right path is this... Code: Copy #if B4A html=html.Replace("[path]",xui.FileUri(dirAssets,"") ) 'has trailing / #else html=html.Replace("[path]",xui.FileUri(dirAssets,"") & "/") 'add trailing / #end if
S sorex Expert Licensed User Longtime User Dec 18, 2018 #4 After upgrading to the B4A 8.80 beta the above suddenly doesn't work anymore. I'm not sure if it is due to a change in the Xui library or somewhere else. I'm using this as workaround which is more safe as it uses a filename and due to the dropping of the conditional lines it's the same amount of lines aswell. Code: Copy Dim path As String path=xui.FileUri(dirAssets,"info.png") 'just point to a valid asset file instead of the previous "" 'hack' path=path.SubString2(0,path.LastIndexOf("/")) 'strip off the filename and leading / again html=html.Replace("[path]",path) Last edited: Dec 18, 2018
After upgrading to the B4A 8.80 beta the above suddenly doesn't work anymore. I'm not sure if it is due to a change in the Xui library or somewhere else. I'm using this as workaround which is more safe as it uses a filename and due to the dropping of the conditional lines it's the same amount of lines aswell. Code: Copy Dim path As String path=xui.FileUri(dirAssets,"info.png") 'just point to a valid asset file instead of the previous "" 'hack' path=path.SubString2(0,path.LastIndexOf("/")) 'strip off the filename and leading / again html=html.Replace("[path]",path)
Erel B4X founder Staff member Licensed User Longtime User Dec 18, 2018 #5 Nothing has changed in XUI.FileURI.