Skip to content

Instantly share code, notes, and snippets.

@giuserpe
Created December 14, 2016 22:37
Show Gist options
  • Select an option

  • Save giuserpe/087255d0cdf62536f9b2b0b97e0fc660 to your computer and use it in GitHub Desktop.

Select an option

Save giuserpe/087255d0cdf62536f9b2b0b97e0fc660 to your computer and use it in GitHub Desktop.
FUNCTION gina_furbetta_2' funzione che prende la data, minuti secondi di sistema e li assembla
' per utilizzarli as esempio come suffisso a nome di file o Altro
'versione corta (poco leggibile)
sdata=now
sp1a = left(sdata,6)
sp1b = right(sdata,11)
sp1 = sp1a & sp1b
sp1 = Replace_G(sp1, "/", "")
sp2 = right(sp1,9)
sp2 =trim(sp2,1)
sp2 = Replace_G(sp2, ".", "")
sp1 = left(sp1,6)
Sp1a = left(sp1,2)
Sp1c = right(sp1,2)
sp1b = mid(sp1, 3 ,2)
sp1b = Replace_G(sp1b, sp1c , "")
' sfine = sp1c & sp1b & sp1a & "_" & sp2
sfine = sp1c & sp1b & sp1a & sp2
gina_furbetta_2 = sfine
END FUNCTION
Sub bak_timestamp ' salva una copia di backup del file ad ogni apertura
oDoc = ThisComponent
If (oDoc.hasLocation()) Then
sDocURL = oDoc.getURL() 'url
sUrl = DirectoryNameoutofPath(sDocURL, "/") 'path
sFileName = GetFileNameWithoutExtension(sDocURL, "/") 'file
Mkdir (convertfromurl(sUrl+"/leeno-bk/"))
sNewURL = sUrl+"/leeno-bk/"+sFileName+"-"+gina_furbetta_2+".ods"
Filecopy sDocURL, sNewURL 'agisce direttamente su disco in modo "trasparente"
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment