Skip to content

Commit f3c5be7

Browse files
committed
interpreter.R args
1 parent 2ca1b46 commit f3c5be7

File tree

4 files changed

+17
-26
lines changed

4 files changed

+17
-26
lines changed

interOp.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
C:/PROGRA~1/R/R-35~1.0/bin/Rscript.exe interpreter.R
1+
C:/PROGRA~1/R/R-35~1.0/bin/Rscript.exe interpreter.R "mainScript.txt"
22
pause
33
cls
44
exit

interpreter.R

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@
44
# This is the main interpreter. This is used to read through the file and call the respective libraries
55
#
66

7+
# TO read console input for ths program
8+
args <- commandArgs(trailingOnly = TRUE)
9+
loadScrit <- function(){
10+
fileName <- ""
11+
if(is.na(args[1])){
12+
fileName <- choose.files()
13+
} else if(args[1] == 1){
14+
fileName <- "mainScript.txt"
15+
} else {
16+
fileName <- args[1]
17+
}
18+
return(fileName)
19+
}
720

8-
9-
10-
script <- readLines("mainScript.txt")
21+
script <- suppressWarnings(readLines("mainScript.interOp")) #This triggers a warning but not an concern
1122
# From loading from a file have to conver to table matrix
1223
script <- as.matrix(script)
1324

@@ -70,7 +81,7 @@ allbounds <- processBounds()
7081
titleRows <- as.integer(allbounds[,1])
7182
source("processRequest.R")
7283

73-
testPiper <- function(firstFunc, secondFunc){
84+
Piper <- function(firstFunc, secondFunc){
7485

7586
#Run first return output
7687
firstFunc <- processFunction(match(firstFunc, allbounds[,3])) #Now it has the output val of first funct
@@ -109,7 +120,7 @@ master <- function(){
109120
if(headTag[2] == "**<<"){
110121
#Then we need to pass both func bounds
111122
#print(headTag)
112-
print(testPiper(headTag[1], headTag[3]))
123+
print(Piper(headTag[1], headTag[3]))
113124
}
114125
}
115126
}

mainScript

Lines changed: 0 additions & 20 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)