| 2 | |
| 3 | |
| 4 | {{{ |
| 5 | Func _PathMake($sDrive, $sDir, $sFileName, $sExtension) |
| 6 | ; Format $sDrive, if it's not a UNC server name, then just get the drive letter and add a colon |
| 7 | If StringLen($sDrive) Then |
| 8 | If Not (StringLeft($sDrive, 2) = "\\") Then $sDrive = StringLeft($sDrive, 1) & ":" |
| 9 | EndIf |
| 10 | |
| 11 | ; Format the directory by adding any necessary slashes |
| 12 | If StringLen($sDir) Then |
| 13 | If Not (StringRight($sDir, 1) = "\") And Not (StringRight($sDir, 1) = "/") Then $sDir = $sDir & "\" |
| 14 | Else |
| 15 | $sDir = "\" |
| 16 | EndIf |
| 17 | |
| 18 | If StringLen($sDir) Then |
| 19 | ; Append a backslash to the start of the directory if required |
| 20 | If Not (StringLeft($sDir, 1) = "\") And Not (StringLeft($sDir, 1) = "/") Then $sDir = "\" & $sDir |
| 21 | EndIf |
| 22 | |
| 23 | ; Nothing to be done for the filename |
| 24 | |
| 25 | ; Add the period to the extension if necessary |
| 26 | If StringLen($sExtension) Then |
| 27 | If Not (StringLeft($sExtension, 1) = ".") Then $sExtension = "." & $sExtension |
| 28 | EndIf |
| 29 | |
| 30 | Return $sDrive & $sDir & $sFileName & $sExtension |
| 31 | EndFunc ;==>_PathMake |
| 32 | }}} |