I am developing offline my web programs and test online.
I wrote a little tool to change the path from offline to online.
Best regards
Otto
- Code: Select all Expand view RUN
#include "FiveWin.ch"
static oWnd
static cResultPath := ""
//----------------------------------------------------------------------------//
function Main( cDbfFile )
local aFiles := {}
*----------------------------------------------------------
IF cDbfFile<>nil
AADD( aFiles, cDbfFile )
endif
DEFINE WINDOW oWnd TITLE "Droping Files from FileManager to change path from local to web"
@ 10,10 ;
BTNBMP ;
PROMPT "Path to Clipboard" ;
OF oWnd ;
ACTION ( CopyToClipboard( ), oWnd:End() )
oWnd:bInit := {||IIF( cDbfFile<>nil, ( PaintTheName( 0, 0, afiles ) ), ), oWnd:refresh() }
ACTIVATE WINDOW oWnd ;
ON DROPFILES PaintTheName( nRow, nCol, aFiles )
return nil
//----------------------------------------------------------------------------//
function PaintTheName( nRow, nCol, aFiles )
local cName, cResult := ""
local n := 1
while ! Empty( cName := StrToken( aFiles[ 1 ], n++, "\" ) )
if "~" $ cName
cName = SFN2LFN( cResult + cName )
endif
cResult += cName + "\"
end
cResult = SubStr( cResult, 1, Len( cResult ) - 1 )
oWnd:Say( nRow, nCol, cResult,,,, .t. ) // Say in pixels
cResultPath := cResult
return nil
//----------------------------------------------------------------------------//
function CopyToClipboard( )
local cText:= lower( cResultPath )
local oClip := TClipBoard():New()
cText := STRTRAN( cText, "c:\www\htdocs\", "https://winhotel.space/" )
cText := STRTRAN(cText, "\", "/" )
if oClip:Open()
oClip:SetText( cText )
oClip:Close()
endif
oClip:End()
return nil
//----------------------------------------------------------------------------//